Skip to main content

ASF Common Python Methods

Project description

asfpy - ASF Infrastructure Common Library for Python functions

PyPI PyPI - Python Versions Unit Tests Apache License

This Python library contains features commonly used at the Apache Software Foundation.

(For asfpy 0.37 and below, look at our old Subversion repository)

Package Documention

  • aioldap: asynchronous LDAP client (documentation TBD)
  • clitools: LDAP work via command line tooling (documentation TBD)
  • crypto: helper for ED25519 work (documentation TBD)
  • db: high performance simplified SQLite client (documentation TBD)
  • justone: helper to ensure only one long-running process is operating (documentation TBD)
  • messaging: helpers to send email (documentation TBD)
  • pubsub: client for subscribing to the ASF pubsub service (documentation TBD)
  • sqlite: document-based CRUD using SQLite (documentation TBD)
  • stopwatch: debug/logging timing for Python code. See documentation
  • syslog: redirect print() to syslog (documentation TBD)
  • twatcher: watch EZT emplates for edits, then reload (documentation TBD)
  • whoami: fetch hostname of box (documentation TBD)

--

  • daemon: DEPRECATED old code to spawn a daemon (obsoleted by pipservice)
  • ldapadmin: DEPRECATED internal ASF infra tooling (moved to internal infra)

Building asfpy package

Prerequisites:

  • poetry: install e.g. with pipx pipx install poetry

Building the package:

$ poetry build

Running the tests:

$ poetry run pytest

Note: the above run might use system/local package install. Configure the poetry virtual environment with:

$ poetry install

Poetry might want to use a keyring. To disable that (and stick to a token in your poetry config), then use the following:

$ poetry config keyring.enabled false

Then to override the default asfpy install, and test the wheel that was built (eg. before pushing the wheel to PyPI):

$ poetry run pip install ./dist/asfpy-0.56-py3-none-any.whl

Running pytest will now use the built wheel.

Installation

Create and activate a virtual environment and then install asfpy using pip:

$ pip install "asfpy"

Note: Adding [ldap] or [aioldap] extras will install optional dependencies for LDAP support that will require additional system dependencies:

$ pip install "asfpy[aioldap]"

Publishing a new asfpy package

Create an account on https://pypi.org/, then add a token with an "all projects" scope.

Configure your credentials for the pypi repository:

$ poetry config pypi-token.pypi <your-token>

Finally publish to pypi.org:

$ make publish

See this guide for more details on working with PyPi.

Please also create a tag for the release.

Publishing to test.pypi.org

Create an account on https://test.pypi.org/, then add a token with an "all projects" scope.

Add a testpypi repository to your poetry config:

$ poetry config repositories.testpypi https://test.pypi.org/legacy/

Configure your credentials for the testpypi repository:

$ poetry config pypi-token.testpypi <your-token>

Finally publish to test.pypi.org:

$ make publish-test

The package should upload to the test.pypi.org service.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asfpy-0.57.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asfpy-0.57-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file asfpy-0.57.tar.gz.

File metadata

  • Download URL: asfpy-0.57.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/23.4.0

File hashes

Hashes for asfpy-0.57.tar.gz
Algorithm Hash digest
SHA256 a34a260b232bbcbf8700d7119fe01b9ab80b1a36a929604afc85264fda45e942
MD5 63162c89f506844f302ed69212e2894f
BLAKE2b-256 2bd1df38cf08be73d93cb916a94c8dbf8f5fd7fd9a48c5fd712c39b9d6d262f7

See more details on using hashes here.

File details

Details for the file asfpy-0.57-py3-none-any.whl.

File metadata

  • Download URL: asfpy-0.57-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/23.4.0

File hashes

Hashes for asfpy-0.57-py3-none-any.whl
Algorithm Hash digest
SHA256 f59f12001772a4c7bccfc2320067c0db94ff9c09946026b505fe1be41f60af59
MD5 894e9f6e41ef4bb86a097a91bf7c2700
BLAKE2b-256 17834f456e6139d1daf1b137f2c7354a87fa7b241fdf602cc88e4f7505f0db02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page