# APINum Library
## Overview
APINum is a Python library designed for extracting well numbers, such as API (American Petroleum Institute) numbers, now known as US Well Numbers, from strings. It validates well numbers against predefined codes and supports different digit formats for API numbers/US Well Numbers.
## Installation
Install APINum directly using pip:
pip install apinum
## Features
- Extract well numbers from strings.
- Validate well numbers against a list of predefined codes.
- Support for 10, 12, and 14-digit API number formats.
- Provides formatted and unformatted well number outputs.
## Usage
To use APINum, import and initialize the `APINumber` class with a string containing a well number. The class parses and extracts the API number from the string.
```python
from apinum import APINumber
# Example string containing an API number
input_string = "Your string containing API number"
api_number = APINumber(input_string)
# Access extracted API number and other details
print(api_number.extracted_number)
print(api_number.formatted_14_digit)
```
### Available Attributes
`APINumber` provides the following attributes to access the extracted number details:
- `extracted_number`: The raw extracted API number.
- `formatted_14_digit`: Formatted 14-digit API number.
- `formatted_12_digit`: Formatted 12-digit API number.
- `formatted_10_digit`: Formatted 10-digit API number.
- `unformatted_14_digit`: Unformatted 14-digit API number.
- `unformatted_12_digit`: Unformatted 12-digit API number.
- `unformatted_10_digit`: Unformatted 10-digit API number.
## Error Handling
`APINumber` raises exceptions for invalid inputs or if no API number is found:
- `TypeError`: Input is not a valid string.
- `ValueError`: No API number found in the input string.
## Configuration
The library uses JSON files for valid API codes and mappings. Ensure these files are correctly set up in your working directory.
## Contribution
Contributions are welcome. Follow standard practices for contributing to Python packages, such as forking the repository, making changes, and submitting a pull request.
## License
Include the license here to inform users of their rights when using and modifying the APINum library.
Raw data
{
"_id": null,
"home_page": null,
"name": "apinum",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "US Well Numbers, API Numbers, Well Numbers, apinum",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/be/6a/a5a1ef4c808865864d7fe42d4a82c1b3caf3d685719e92fb7514aa84ec9c/apinum-0.1.8.tar.gz",
"platform": null,
"description": "# APINum Library\n\n## Overview\nAPINum is a Python library designed for extracting well numbers, such as API (American Petroleum Institute) numbers, now known as US Well Numbers, from strings. It validates well numbers against predefined codes and supports different digit formats for API numbers/US Well Numbers.\n\n## Installation\nInstall APINum directly using pip:\n\n pip install apinum\n\n## Features\n- Extract well numbers from strings.\n- Validate well numbers against a list of predefined codes.\n- Support for 10, 12, and 14-digit API number formats.\n- Provides formatted and unformatted well number outputs.\n\n## Usage\nTo use APINum, import and initialize the `APINumber` class with a string containing a well number. The class parses and extracts the API number from the string.\n\n```python\nfrom apinum import APINumber\n\n# Example string containing an API number\ninput_string = \"Your string containing API number\"\napi_number = APINumber(input_string)\n\n# Access extracted API number and other details\nprint(api_number.extracted_number)\nprint(api_number.formatted_14_digit)\n```\n\n### Available Attributes\n`APINumber` provides the following attributes to access the extracted number details:\n- `extracted_number`: The raw extracted API number.\n- `formatted_14_digit`: Formatted 14-digit API number.\n- `formatted_12_digit`: Formatted 12-digit API number.\n- `formatted_10_digit`: Formatted 10-digit API number.\n- `unformatted_14_digit`: Unformatted 14-digit API number.\n- `unformatted_12_digit`: Unformatted 12-digit API number.\n- `unformatted_10_digit`: Unformatted 10-digit API number.\n\n## Error Handling\n`APINumber` raises exceptions for invalid inputs or if no API number is found:\n- `TypeError`: Input is not a valid string.\n- `ValueError`: No API number found in the input string.\n\n## Configuration\nThe library uses JSON files for valid API codes and mappings. Ensure these files are correctly set up in your working directory.\n\n## Contribution\nContributions are welcome. Follow standard practices for contributing to Python packages, such as forking the repository, making changes, and submitting a pull request.\n\n## License\nInclude the license here to inform users of their rights when using and modifying the APINum library.\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.8",
"project_urls": {
"homepage": "https://github.com/bzlmnop/apinum"
},
"split_keywords": [
"us well numbers",
" api numbers",
" well numbers",
" apinum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3bf6ecef30f3e183d175e5b671f12a02f1e9de73a4d4beaf607ad763edb350ff",
"md5": "8d9ea705f96e43e8958bddf5ed8eef2b",
"sha256": "a8c31e181f6b8467dddbab90065c5cfcf7382ba9de20fe2439995ba808cef32a"
},
"downloads": -1,
"filename": "apinum-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8d9ea705f96e43e8958bddf5ed8eef2b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 35645,
"upload_time": "2024-04-11T05:43:43",
"upload_time_iso_8601": "2024-04-11T05:43:43.567204Z",
"url": "https://files.pythonhosted.org/packages/3b/f6/ecef30f3e183d175e5b671f12a02f1e9de73a4d4beaf607ad763edb350ff/apinum-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "be6aa5a1ef4c808865864d7fe42d4a82c1b3caf3d685719e92fb7514aa84ec9c",
"md5": "25bc8fb4e7f757aa96f08fc1347c1cfc",
"sha256": "6e1a609335472a2eb10542adcd3c4022a3d60b17723dfc88a964e87c63bcdb8b"
},
"downloads": -1,
"filename": "apinum-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "25bc8fb4e7f757aa96f08fc1347c1cfc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 37372,
"upload_time": "2024-04-11T05:43:45",
"upload_time_iso_8601": "2024-04-11T05:43:45.300734Z",
"url": "https://files.pythonhosted.org/packages/be/6a/a5a1ef4c808865864d7fe42d4a82c1b3caf3d685719e92fb7514aa84ec9c/apinum-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-11 05:43:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bzlmnop",
"github_project": "apinum",
"github_not_found": true,
"lcname": "apinum"
}