========================
CTI DB Python Module
========================
Description
-----------
This is a Python module for reading CTI DB files.
CTI DB is a binary file format that stores data indexed by IP address
subnets (IPv4 only).
Installation
------------
To install ctidb, simply:
.. code-block:: bash
$ pip install ctidb
Usage
-----
To use this module, you must first download or create a CTI DB file.
After you have obtained a database and imported the module, call
``CCtiReader`` with a path,
to the database as the first argument. Optionally, you may pass a mode as the
second argument. The modes are exported from ``ctidb``. Valid modes are:
* ``MODE_MEMORY`` - load database into memory. Pure Python.
* ``MODE_AUTO`` - Default.
**NOTE**:
To look up an IP address, use the ``get`` method on this object. The method will return the
corresponding values for the IP address from the database (e.g., a dictionary
for GeoIP2/GeoLite2 databases). If the database does not contain a record for
that IP address, the method will return ``None``.
Example
-------
.. code-block:: pycon
>>> import ctidb
>>>
>>> with ctidb.CCtiReader('criminalip.ctidb') as reader:
>>>
>>> reader.get('223.26.31.75')
{'country': ... }
Exceptions
----------
The module will return an ``InvalidDatabaseError`` if the database is corrupt
or otherwise invalid. A ``ValueError`` will be thrown if you look up an
invalid IP address or an IPv6 address in an IPv4 database.
Requirements
------------
This code requires Python 3.7+. Older versions are not supported.
Versioning
----------
Support
-------
Raw data
{
"_id": null,
"home_page": "https://github.com/aispera/ctidb",
"name": "ctidb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "aispera, ctidb, criminalip",
"author": "aispera",
"author_email": "infra@aispera.com",
"download_url": "https://files.pythonhosted.org/packages/b5/49/7545b7459c7674c6eff193feef6bb8e8d3d3749cee6f6af85d6ac60f2fcf/ctidb-1.1.14.tar.gz",
"platform": null,
"description": "========================\nCTI DB Python Module\n========================\n\nDescription\n-----------\n\nThis is a Python module for reading CTI DB files.\n\nCTI DB is a binary file format that stores data indexed by IP address\nsubnets (IPv4 only).\n\nInstallation\n------------\n\nTo install ctidb, simply:\n\n.. code-block:: bash\n\n $ pip install ctidb\n\nUsage\n-----\n\nTo use this module, you must first download or create a CTI DB file.\n\nAfter you have obtained a database and imported the module, call\n``CCtiReader`` with a path,\nto the database as the first argument. Optionally, you may pass a mode as the\nsecond argument. The modes are exported from ``ctidb``. Valid modes are:\n\n* ``MODE_MEMORY`` - load database into memory. Pure Python.\n* ``MODE_AUTO`` - Default.\n\n**NOTE**:\nTo look up an IP address, use the ``get`` method on this object. The method will return the\ncorresponding values for the IP address from the database (e.g., a dictionary\nfor GeoIP2/GeoLite2 databases). If the database does not contain a record for\nthat IP address, the method will return ``None``.\n\nExample\n-------\n\n.. code-block:: pycon\n\n >>> import ctidb\n >>>\n >>> with ctidb.CCtiReader('criminalip.ctidb') as reader:\n >>>\n >>> reader.get('223.26.31.75')\n {'country': ... }\n\nExceptions\n----------\n\nThe module will return an ``InvalidDatabaseError`` if the database is corrupt\nor otherwise invalid. A ``ValueError`` will be thrown if you look up an\ninvalid IP address or an IPv6 address in an IPv4 database.\n\nRequirements\n------------\n\nThis code requires Python 3.7+. Older versions are not supported.\n\nVersioning\n----------\n\n\n\nSupport\n-------\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "criminalip.ctidb reader",
"version": "1.1.14",
"project_urls": {
"Homepage": "https://github.com/aispera/ctidb"
},
"split_keywords": [
"aispera",
" ctidb",
" criminalip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "db751cbfa4b4e309c6a88b3a802f1a27e1a6297a7ba87dc36754810798c80e16",
"md5": "c4e1c2d57b3ef7031bb51bfbbed44363",
"sha256": "41a3185d15e0af48da8a1dfa038145625b5be9559e0dfb4fb320f49dec306611"
},
"downloads": -1,
"filename": "ctidb-1.1.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c4e1c2d57b3ef7031bb51bfbbed44363",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 13500,
"upload_time": "2024-08-21T07:30:30",
"upload_time_iso_8601": "2024-08-21T07:30:30.826900Z",
"url": "https://files.pythonhosted.org/packages/db/75/1cbfa4b4e309c6a88b3a802f1a27e1a6297a7ba87dc36754810798c80e16/ctidb-1.1.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b5497545b7459c7674c6eff193feef6bb8e8d3d3749cee6f6af85d6ac60f2fcf",
"md5": "45d0f69e37d132205b87aa7627031e6b",
"sha256": "d868f29de2b0954060b0a9bd08e6ea914ad2cf03c05e9ea8cbe891d287e957ea"
},
"downloads": -1,
"filename": "ctidb-1.1.14.tar.gz",
"has_sig": false,
"md5_digest": "45d0f69e37d132205b87aa7627031e6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 13569,
"upload_time": "2024-08-21T07:30:33",
"upload_time_iso_8601": "2024-08-21T07:30:33.037455Z",
"url": "https://files.pythonhosted.org/packages/b5/49/7545b7459c7674c6eff193feef6bb8e8d3d3749cee6f6af85d6ac60f2fcf/ctidb-1.1.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 07:30:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aispera",
"github_project": "ctidb",
"github_not_found": true,
"lcname": "ctidb"
}