Skip to main content

acq builds.sr.ht status

What it is?!

This library provides a simple and convenient way to automatically search packages for modules and import them without needing project files to manually import them, which allows for automatic configuration and other useful mechanics within projects.

Installation

You can install this module via pip or your preferred dependency management tool(s):

pip install acq

Usage

In standard Python applications, the tool can be used in the following ways:

from acq import discover

# Import modules 'a' and 'b' from packages "example1" and "example2"
discover('a', 'b', package_names=['example1', 'example2'])

Furthermore, you can extend this functionality to provide you all classes or instances matching a specific class within discovered modules:

from csv import DictReader
from acq import discover

# Import modules 'readers' from packages "example1" and "example2"
# and get any instances, subclasses of, or references to
# DictReader from within them
results = discover(
    'readers',
    package_names=['example1', 'example2']),
    types=(DictReader,),
)

print(list(results.DictReader))

In Django applications, you can automatically import from INSTALLED_APPS via:

from acq.django import discover

# Import views.py for all packages in the INSTALLED_APPS setting
discover('views')

# Import views.py for all packages in an AUTOSEARCH_MODULES setting
discover('views', packages_setting_name='AUTOSEARCH_MODULES')

Contributing

Thank you for considering use of this project, and please feel free to provide any suggestions in pull requests if you have any!

Metadata

Release files for acq 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acq 0.2.3
File Size Uploaded
acq-0.2.3.tar.gz 6.3 kB Details

Release files / acq-0.2.3.tar.gz

Download URL acq-0.2.3.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9109d5b035711f3266a10b91b63d9b801f4c802b5b4a19be13adba6e2171b8a3
BLAKE2b-256 checksum
How to use checksums
cff09c78ac0fa96f5617bb03dd55769cbb9d6feccdf318b9a11ff4624259dfcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page