Catalog PyPI
Back to packageRELEASE DETAILS

0.2.3

PyPI

acq

automatic acquisition of modules from packages

Published27 Mar 2025
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.2.3 documentation

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!

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
acq-0.2.3.tar.gz

sdist · 6.14 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:23 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:85a3e8d4e2b40fc258e0c94ea167ac7a2c8f5d59e1711f0dd6f7227ef68d99c9

Other collected versions

View all collected versions →