SRV resolver
Helper to get record from SRV address according to RFC2782.
Features
- support of record weights and priorities
- check service availability at specific port
- random record selector
- cache with ttl support
Install
The package can be installed simply by using pip:
pip install srvresolver
Example
from srvresolver.srv_resolver import SRVResolver
# get all records
SRVResolver.resolve('_service._tcp.example.com')
# get one random record with working connection
SRVResolver.resolve_random('_service._tcp.example.com')
# get first available server
SRVResolver.resolve_first('_service._tcp.example.com')
Adds
Resolver with DNS cache
This one uses cache implemented in dnspython module.
from srvresolver.srv_resolver_cached import SRVResolverCached
# get all records
SRVResolverCached.resolve('_service._tcp.example.com')
# same but don't do dns request, load from cache if not expired
SRVResolverCached.resolve('_service._tcp.example.com')
Postgres SRV record resolver
Extract postgres records from SRV and check whether master or slave. Requires psycopg2
from srvresolver.postgres_resolver import PostgresResolver
# get random working slave record
PostgresResolver.get_slave('_postgresql._tcp.example.com', username, password)
# get random working master record
PostgresResolver.get_master('_postgresql._tcp.example.com', username, password)
Metadata
Release files for srvresolver 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| srvresolver-0.3.5.tar.gz | 5.4 kB | Without provenance | Details for srvresolver-0.3.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| srvresolver-0.3.5-py3-none-any.whl | Python 3 | none | any | Details for srvresolver-0.3.5-py3-none-any.whl |
Total release size: 13.3 kB
Release files / srvresolver-0.3.5.tar.gz
| Download URL | srvresolver-0.3.5.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a8973d340486830ddd057895769cb672c7cd902ae61c21339875ed2a9d7ec0f
|
|
BLAKE2b-256 checksum How to use checksums |
bccfd3afddfaa830fa93e1eaf1d94cff14c5de604ff59caacc337a668a231cb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
|
Release files / srvresolver-0.3.5-py3-none-any.whl
| Download URL | srvresolver-0.3.5-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0cbb756d929b267e03dac98ea6d9a188d5ce6c8d30ca5553ed6737fb5ddd1c09
|
|
BLAKE2b-256 checksum How to use checksums |
688b4b709c286edcce48fca1c003cff66f2a8b34c6fda0c580611544f3afe814
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
|
Security for srvresolver 0.3.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.