# **Fueled**
The **_fueled_** package is a Python library designed to assist in calculating and managing vehicle gas mileage, providing
functionalities to compute fuel consumption, mileage, and perform unit conversions.
## **Features**
- Calculate fuel consumption based on distance and MPG (miles per gallon).
- Support for both city and highway MPG values.
- Convert between different units of measurement for mileage and fuel consumption.
## **Installation**
You can install the package via pip:
```bash
pip install fueled
```
## **Usage**
### Vehicle and Trip objects
### _<ins>Vehicle:</ins>_
##### Attributes:
- **_year_**
- This is the year of the vehicle
- Mandatory attribute
- **_make_**
- This is the manufacturer/manufacturing company of the vehicle
- Mandatory attribute
- **_model_**
- This is the specific model of the vehicle
- Mandatory attribute
- **_transmission_**
- This is the type of transmission that the vehicle has
- The two options for this attribute are currently 'automatic' or 'manual'
- The default value will be 'automatic' if no other value is chosen
- Optional attribute
##### Methods:
- **_specs()_**
- Function that returns a list of all the vehicles and specifications that match the year, make and model of the vehicle instance
- Takes no input values
- **_fuelConsumption(_** <ins>trip</ins> **_)_**
- Function that calculates the fuel consumption of the vehicle instance. It will return a list of vehicles that match the year, make and model of the vehicle instance
- Takes in a _trip_ object instance to calculate the fuel consumption
### _<ins>Trip:</ins>_
##### Attributes:
- **_distance_**
- This is the total distance of the trip (miles or kilometers)
- Mandatory attribute
- **_units_**
- This is the unit of measurement that should (for miles - 'mi' / for kilometers - 'km')
- The defualt value for _units_ is miles - 'mi'
- Optional attribute
- **_city_driving_**
- This is the amount of city driving that for the trip instance
- Measured as a percentage value that is represented as a positive float less than the whole number 1
- The default value for city driving is '0.55' or 55%
- It can be assumed that the difference between 1 and the city driving, will be the amount of highway driving
#### Example:
```python
# Trip instance
trip1 = Trip(distance=120, units='mi', city_driving=0.40)
print(f'City Driving: {trip1.city_driving}')
print(f'Highway Driving: {trip1.hwy_driving}')
```
```bash
City Driving: 0.40
Highway Driving: 0.60
```
##### Methods:
- **_milesToKilometers()_**
- Function for converting trip in miles to kilometers
- Takes no input values
- **_kilometersToMiles()_**
- Function for converting the trip in kilometers to miles
- Takes no input values
<!-- ### Calculating Fuel Consumption -->
### Example
1. Import the 'Vehicle' and 'Trip' classes
2. Create vehicle and trip instances
3. Using the 'fuelConsumption()' method from 'Vehicle', calculate the fuel consumption of the vehicle instance
<!-- - Vehicle must have the 'year', 'make' and 'model' attributes to create a vehicle instance (the 'transmission' attribute is optional and will default to 'automatic' if user does not define it as 'automatic' or 'manual') **Note** 'automatic' or 'manual' are currently the only accepted options
- Trip must have the 'distance' attribute to create a trip instance (the 'units' and 'city_driving' attributes are optional; 'units' will default to 'mi' - ("miles") if user does not define it as 'mi' - ("miles") or 'ki' ("kilometers") / 'city_driving' will default to '55%' or '0.55' if not defined and should always be a positive decimal less than 1) -->
```python
from fueled import Vehicle, Trip
# Provide the vehicle's details
car = Vehicle(year=2000, make='Ford', model='E150')
# Provide inputs for the trip's total distance, units of measurement and percentage of city and highway driving
trip = Trip(distance=100, units='km', city_driving=0.55)
# Call the 'fuelConsumption' method from the vehicle instance and provide the trip object to calculate the fuel consumption
fuel_consumption = car.fuelConsumption(trip)
```
```bash
[{'_id': '16206',
'alt_fuel': 'none',
'city_mpg_fuel1': 13,
'city_mpg_fuel2': 0,
'combined_mpg_fuel1': 15,
'combined_mpg_fuel2': 0,
'cylinders': '8',
'displacement': '4.6',
'displacement_measure': 'liters',
'drivetrain': 'Rear-Wheel Drive',
'eng_id': '0',
'est_consumption_gal': 6.47,
'fuel_source': 'single fuel',
'fuel_type': 'Regular',
'has_mpg_data': 'Y',
'hwy_mpg_fuel1': 17,
'hwy_mpg_fuel2': 0,
'make': 'Ford',
'model': 'E150 Club Wagon',
'primary_fuel': 'Regular Gasoline',
'sub_cat': 'Vans, Passenger Type',
'transmission': 'Automatic 4-spd',
'year': 2000},
{'_id': '16207',
'alt_fuel': 'none',
'city_mpg_fuel1': 12,
'city_mpg_fuel2': 0,
'combined_mpg_fuel1': 13,
'combined_mpg_fuel2': 0,
'cylinders': '8',
'displacement': '5.4',
'displacement_measure': 'liters',
'drivetrain': 'Rear-Wheel Drive',
'eng_id': '0',
'est_consumption_gal': 7.42,
'fuel_source': 'single fuel',
'fuel_type': 'Regular',
'has_mpg_data': 'Y',
'hwy_mpg_fuel1': 16,
'hwy_mpg_fuel2': 0,
'make': 'Ford',
'model': 'E150 Club Wagon',
'primary_fuel': 'Regular Gasoline',
'sub_cat': 'Vans, Passenger Type',
'transmission': 'Automatic 4-spd',
'year': 2000}]
```
Raw data
{
"_id": null,
"home_page": "https://github.com/shoshone-s/fueled",
"name": "fueled",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11.0",
"maintainer_email": "",
"keywords": "",
"author": "shoshone-s",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/ee/b3/3ad9e26c1b4e39016993850625505bf11a2d8ae2d58bbc81f0a821e066cb/fueled-0.0.4.tar.gz",
"platform": null,
"description": "# **Fueled**\n\nThe **_fueled_** package is a Python library designed to assist in calculating and managing vehicle gas mileage, providing\nfunctionalities to compute fuel consumption, mileage, and perform unit conversions.\n\n## **Features**\n\n- Calculate fuel consumption based on distance and MPG (miles per gallon).\n- Support for both city and highway MPG values.\n- Convert between different units of measurement for mileage and fuel consumption.\n\n## **Installation**\n\nYou can install the package via pip:\n\n```bash\npip install fueled\n```\n\n## **Usage**\n\n### Vehicle and Trip objects\n\n### _<ins>Vehicle:</ins>_\n\n##### Attributes:\n\n- **_year_**\n - This is the year of the vehicle\n\n - Mandatory attribute\n\n- **_make_**\n - This is the manufacturer/manufacturing company of the vehicle\n\n - Mandatory attribute\n\n- **_model_**\n - This is the specific model of the vehicle\n\n - Mandatory attribute\n\n- **_transmission_**\n - This is the type of transmission that the vehicle has\n\n - The two options for this attribute are currently 'automatic' or 'manual'\n\n - The default value will be 'automatic' if no other value is chosen\n\n - Optional attribute\n\n##### Methods:\n- **_specs()_** \n - Function that returns a list of all the vehicles and specifications that match the year, make and model of the vehicle instance\n\n - Takes no input values\n\n- **_fuelConsumption(_** <ins>trip</ins> **_)_** \n - Function that calculates the fuel consumption of the vehicle instance. It will return a list of vehicles that match the year, make and model of the vehicle instance\n\n - Takes in a _trip_ object instance to calculate the fuel consumption\n\n### _<ins>Trip:</ins>_\n\n##### Attributes:\n\n- **_distance_**\n - This is the total distance of the trip (miles or kilometers)\n\n - Mandatory attribute\n\n- **_units_**\n - This is the unit of measurement that should (for miles - 'mi' / for kilometers - 'km')\n \n - The defualt value for _units_ is miles - 'mi'\n \n - Optional attribute\n\n- **_city_driving_**\n - This is the amount of city driving that for the trip instance\n \n - Measured as a percentage value that is represented as a positive float less than the whole number 1\n\n - The default value for city driving is '0.55' or 55%\n\n - It can be assumed that the difference between 1 and the city driving, will be the amount of highway driving\n #### Example:\n ```python\n # Trip instance\n trip1 = Trip(distance=120, units='mi', city_driving=0.40)\n print(f'City Driving: {trip1.city_driving}')\n print(f'Highway Driving: {trip1.hwy_driving}')\n ```\n ```bash\n City Driving: 0.40\n Highway Driving: 0.60\n ```\n\n##### Methods:\n- **_milesToKilometers()_**\n - Function for converting trip in miles to kilometers\n\n - Takes no input values\n\n- **_kilometersToMiles()_**\n - Function for converting the trip in kilometers to miles\n\n - Takes no input values\n\n<!-- ### Calculating Fuel Consumption -->\n### Example\n1. Import the 'Vehicle' and 'Trip' classes\n2. Create vehicle and trip instances\n3. Using the 'fuelConsumption()' method from 'Vehicle', calculate the fuel consumption of the vehicle instance\n <!-- - Vehicle must have the 'year', 'make' and 'model' attributes to create a vehicle instance (the 'transmission' attribute is optional and will default to 'automatic' if user does not define it as 'automatic' or 'manual') **Note** 'automatic' or 'manual' are currently the only accepted options\n - Trip must have the 'distance' attribute to create a trip instance (the 'units' and 'city_driving' attributes are optional; 'units' will default to 'mi' - (\"miles\") if user does not define it as 'mi' - (\"miles\") or 'ki' (\"kilometers\") / 'city_driving' will default to '55%' or '0.55' if not defined and should always be a positive decimal less than 1) -->\n\n```python\nfrom fueled import Vehicle, Trip\n\n# Provide the vehicle's details\ncar = Vehicle(year=2000, make='Ford', model='E150')\n\n# Provide inputs for the trip's total distance, units of measurement and percentage of city and highway driving\ntrip = Trip(distance=100, units='km', city_driving=0.55)\n\n# Call the 'fuelConsumption' method from the vehicle instance and provide the trip object to calculate the fuel consumption\nfuel_consumption = car.fuelConsumption(trip)\n```\n```bash\n[{'_id': '16206',\n 'alt_fuel': 'none',\n 'city_mpg_fuel1': 13,\n 'city_mpg_fuel2': 0,\n 'combined_mpg_fuel1': 15,\n 'combined_mpg_fuel2': 0,\n 'cylinders': '8',\n 'displacement': '4.6',\n 'displacement_measure': 'liters',\n 'drivetrain': 'Rear-Wheel Drive',\n 'eng_id': '0',\n 'est_consumption_gal': 6.47,\n 'fuel_source': 'single fuel',\n 'fuel_type': 'Regular',\n 'has_mpg_data': 'Y',\n 'hwy_mpg_fuel1': 17,\n 'hwy_mpg_fuel2': 0,\n 'make': 'Ford',\n 'model': 'E150 Club Wagon',\n 'primary_fuel': 'Regular Gasoline',\n 'sub_cat': 'Vans, Passenger Type',\n 'transmission': 'Automatic 4-spd',\n 'year': 2000},\n {'_id': '16207',\n 'alt_fuel': 'none',\n 'city_mpg_fuel1': 12,\n 'city_mpg_fuel2': 0,\n 'combined_mpg_fuel1': 13,\n 'combined_mpg_fuel2': 0,\n 'cylinders': '8',\n 'displacement': '5.4',\n 'displacement_measure': 'liters',\n 'drivetrain': 'Rear-Wheel Drive',\n 'eng_id': '0',\n 'est_consumption_gal': 7.42,\n 'fuel_source': 'single fuel',\n 'fuel_type': 'Regular',\n 'has_mpg_data': 'Y',\n 'hwy_mpg_fuel1': 16,\n 'hwy_mpg_fuel2': 0,\n 'make': 'Ford',\n 'model': 'E150 Club Wagon',\n 'primary_fuel': 'Regular Gasoline',\n 'sub_cat': 'Vans, Passenger Type',\n 'transmission': 'Automatic 4-spd',\n 'year': 2000}]\n```\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python package for vehicle mileage calculations",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/shoshone-s/fueled"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9b813e55576f8d0056b9bd08102f48060dce18430b04aa3a54bd8f07445d396c",
"md5": "0714170400340e1d6d7fcac5c6fabd15",
"sha256": "5f48249a574a914172f0b177948818267bfdc2656be2610a7c51503405957312"
},
"downloads": -1,
"filename": "fueled-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0714170400340e1d6d7fcac5c6fabd15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11.0",
"size": 1165896,
"upload_time": "2024-01-04T06:14:28",
"upload_time_iso_8601": "2024-01-04T06:14:28.616029Z",
"url": "https://files.pythonhosted.org/packages/9b/81/3e55576f8d0056b9bd08102f48060dce18430b04aa3a54bd8f07445d396c/fueled-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eeb33ad9e26c1b4e39016993850625505bf11a2d8ae2d58bbc81f0a821e066cb",
"md5": "81ab855b7a12c6fd57b5784dec1050bb",
"sha256": "3b3ff2fae63e68ae614699440aefc98eaaa25aa3a4c2b8fdf429be419d51cd2d"
},
"downloads": -1,
"filename": "fueled-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "81ab855b7a12c6fd57b5784dec1050bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11.0",
"size": 976057,
"upload_time": "2024-01-04T06:14:31",
"upload_time_iso_8601": "2024-01-04T06:14:31.140727Z",
"url": "https://files.pythonhosted.org/packages/ee/b3/3ad9e26c1b4e39016993850625505bf11a2d8ae2d58bbc81f0a821e066cb/fueled-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-04 06:14:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "shoshone-s",
"github_project": "fueled",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "appnope",
"specs": [
[
"==",
"0.1.3"
]
]
},
{
"name": "asttokens",
"specs": [
[
"==",
"2.4.1"
]
]
},
{
"name": "attrs",
"specs": [
[
"==",
"23.1.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2023.11.17"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "comm",
"specs": [
[
"==",
"0.2.0"
]
]
},
{
"name": "debugpy",
"specs": [
[
"==",
"1.8.0"
]
]
},
{
"name": "decorator",
"specs": [
[
"==",
"5.1.1"
]
]
},
{
"name": "executing",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.6"
]
]
},
{
"name": "ipykernel",
"specs": [
[
"==",
"6.28.0"
]
]
},
{
"name": "ipython",
"specs": [
[
"==",
"8.19.0"
]
]
},
{
"name": "jedi",
"specs": [
[
"==",
"0.19.1"
]
]
},
{
"name": "jupyter_client",
"specs": [
[
"==",
"8.6.0"
]
]
},
{
"name": "jupyter_core",
"specs": [
[
"==",
"5.5.1"
]
]
},
{
"name": "matplotlib-inline",
"specs": [
[
"==",
"0.1.6"
]
]
},
{
"name": "nest-asyncio",
"specs": [
[
"==",
"1.5.8"
]
]
},
{
"name": "outcome",
"specs": [
[
"==",
"1.3.0.post0"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"23.2"
]
]
},
{
"name": "parso",
"specs": [
[
"==",
"0.8.3"
]
]
},
{
"name": "pexpect",
"specs": [
[
"==",
"4.9.0"
]
]
},
{
"name": "platformdirs",
"specs": [
[
"==",
"4.1.0"
]
]
},
{
"name": "prompt-toolkit",
"specs": [
[
"==",
"3.0.43"
]
]
},
{
"name": "psutil",
"specs": [
[
"==",
"5.9.7"
]
]
},
{
"name": "ptyprocess",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "pure-eval",
"specs": [
[
"==",
"0.2.2"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.17.2"
]
]
},
{
"name": "PySocks",
"specs": [
[
"==",
"1.7.1"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.8.2"
]
]
},
{
"name": "pyzmq",
"specs": [
[
"==",
"25.1.2"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "sortedcontainers",
"specs": [
[
"==",
"2.4.0"
]
]
},
{
"name": "stack-data",
"specs": [
[
"==",
"0.6.3"
]
]
},
{
"name": "tornado",
"specs": [
[
"==",
"6.4"
]
]
},
{
"name": "traitlets",
"specs": [
[
"==",
"5.14.0"
]
]
},
{
"name": "trio",
"specs": [
[
"==",
"0.23.2"
]
]
},
{
"name": "trio-websocket",
"specs": [
[
"==",
"0.11.1"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "wcwidth",
"specs": [
[
"==",
"0.2.12"
]
]
},
{
"name": "wsproto",
"specs": [
[
"==",
"1.2.0"
]
]
}
],
"lcname": "fueled"
}