0.0.8
Project description
pgdoc-datatype-parser
Provides PostgreSQL documentation datatypes tables as a dictionary specifying a version. Supports all versions prior to 6.3
.
Quickstart
pip install pgdoc-datatype-parser
You can retrieve all PostgreSQL datatypes for the latest version using:
>>> from pprint import pprint
>>> from pgdoc_datatype_parser import pgdoc_datatypes
>>>
>>> pprint(pgdoc_datatypes())
{'bigint': {'aliases': 'int8', 'description': 'Signed eight-byte integer'},
'bigserial': {'aliases': 'serial8',
'description': 'Autoincrementing eight-byte integer'},
'bit [ (n) ]': {'aliases': None, 'description': 'Fixed-length bit string'},
'bit varying [ (n) ]': {'aliases': 'varbit [ (n) ]',
'description': 'Variable-length bit string'},
'boolean': {'aliases': 'bool', 'description': 'Logical boolean (true/false)'},
'box': {'aliases': None, 'description': 'Rectangular box on a plane'},
'bytea': {'aliases': None, 'description': 'Binary data (byte array)'},
'character [ (n) ]': {'aliases': 'char [ (n) ]',
'description': 'Fixed-length character string'},
'character varying [ (n) ]': {'aliases': 'varchar [ (n) ]',
'description': 'Variable-length character '
'string'},
'cidr': {'aliases': None, 'description': 'Ipv4 or ipv6 network address'},
'circle': {'aliases': None, 'description': 'Circle on a plane'},
'date': {'aliases': None, 'description': 'Calendar date (year, month, day)'},
'double precision': {'aliases': 'float8',
'description': 'Double precision floating-point number '
'(8 bytes)'},
'inet': {'aliases': None, 'description': 'Ipv4 or ipv6 host address'},
'integer': {'aliases': ['int', ' int4'],
'description': 'Signed four-byte integer'},
'interval [ fields ] [ (p) ]': {'aliases': None, 'description': 'Time span'},
'json': {'aliases': None, 'description': 'Textual json data'},
'jsonb': {'aliases': None, 'description': 'Binary json data, decomposed'},
'line': {'aliases': None, 'description': 'Infinite line on a plane'},
'lseg': {'aliases': None, 'description': 'Line segment on a plane'},
'macaddr': {'aliases': None,
'description': 'Mac (media access control) address'},
'macaddr8': {'aliases': None,
'description': 'Mac (media access control) address (eui-64 '
'format)'},
'money': {'aliases': None, 'description': 'Currency amount'},
'numeric [ (p, s) ]': {'aliases': 'decimal [ (p, s) ]',
'description': 'Exact numeric of selectable precision'},
'path': {'aliases': None, 'description': 'Geometric path on a plane'},
'pg_lsn': {'aliases': None, 'description': 'Postgresql log sequence number'},
'pg_snapshot': {'aliases': None,
'description': 'User-level transaction id snapshot'},
'point': {'aliases': None, 'description': 'Geometric point on a plane'},
'polygon': {'aliases': None,
'description': 'Closed geometric path on a plane'},
'real': {'aliases': 'float4',
'description': 'Single precision floating-point number (4 bytes)'},
'serial': {'aliases': 'serial4',
'description': 'Autoincrementing four-byte integer'},
'smallint': {'aliases': 'int2', 'description': 'Signed two-byte integer'},
'smallserial': {'aliases': 'serial2',
'description': 'Autoincrementing two-byte integer'},
'text': {'aliases': None, 'description': 'Variable-length character string'},
'time [ (p) ] [ without time zone ]': {'aliases': None,
'description': 'Time of day (no time '
'zone)'},
'time [ (p) ] with time zone': {'aliases': 'timetz',
'description': 'Time of day, including time '
'zone'},
'timestamp [ (p) ] [ without time zone ]': {'aliases': None,
'description': 'Date and time (no '
'time zone)'},
'timestamp [ (p) ] with time zone': {'aliases': 'timestamptz',
'description': 'Date and time, including '
'time zone'},
'tsquery': {'aliases': None, 'description': 'Text search query'},
'tsvector': {'aliases': None, 'description': 'Text search document'},
'txid_snapshot': {'aliases': None, 'description': 'Pg_snapshot'},
'uuid': {'aliases': None, 'description': 'Universally unique identifier'},
'xml': {'aliases': None, 'description': 'Xml data'}}
You can check what is the latest version using latest_version function:
>>> from pgdoc_datatype_parser import latest_version
>>> latest_version()
'13.1b'
If you want to retrieve PostgreSQL datatypes for other version, you can specify the optional parameter
version
of pgdoc_datatypes function.
All versions can be listed using versions function.
Documentation
# pgdoc_datatypes(version="latest", pg_releases_filepath=None) ⇒ dict
Provides information for all PostgreSQL data types from documentation data types table.
- version (str) Version from which PostgreSQL datatypes will be retrieved.
- pg_releases_filepath (str) Path to PostgreSQL releases- commits file. By default, the file included with the package will be used.
# versions(pg_releases_filepath=None) ⇒ list
Returns all PostgreSQL available versions.
- pg_releases_filepath (str) Path to PostgreSQL releases- commits file. By default, the file included with the package will be used.
# latest_version(pg_releases_filepath=None) ⇒ str
Returns latest PostgreSQL available version.
- pg_releases_filepath (str) Path to PostgreSQL releases- commits file. By default, the file included with the package will be used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pgdoc-datatype-parser-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c07951efd0ed34cec4154a8c6b73cafd72577a1ce7114fdf0f24e61a303d61e |
|
MD5 | 6f2342c7f7f1ca1dfd811f94cb1cf130 |
|
BLAKE2b-256 | 1f19d9d106b31ad16661f88f83819edd9aa2f5eefa1a2a6d39d6e4cb8e7c68ee |
Hashes for pgdoc_datatype_parser-0.0.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c3c0f5c64fb710562f0264226973a26f644cc5e7d127f6971a3a5b4e685755 |
|
MD5 | 573aa0769688989ae0f58657466de3f2 |
|
BLAKE2b-256 | b6ba5e4a17d6e204aa43e7b1ff9d3606914ea540e03dc4d9f38622dcd6ca1662 |