Skip to main content

What is it? CI codecov

Prefer is a library for helping you manage application configurations while providing your users the flexibility of using whatever configuration format fits their needs.

It provides a set of interfaces which provide standard methods for reading arbitrary project configuration data. This can vary from simple cases like JSON, to more complicated examples - such as retreiving configuration data from a database.

How do I use it?

Firstly, you'll want to install the module. This can be done easily with easy_install or pip.

easy_install prefer

Prefer is fairly simple to use. A basic use case might be that you have the following JSON configuration in settings.json:

{
  "auth": {
    "username": "user",
    "password": "pass"
  }
}

You can load these settings with the following code using promises:

import prefer

configuration = await prefer.load('settings')
username = configration.get('auth.username')

You will notice that prefer only required 'settings' as the filename. It is recommended to be given without a path or extension, because prefer takes care of looking through the filesystem for configuration files. On both Unix and Windows systems, it will look in all of the standard folders, as well as some conventional places where people like to put their configurations.

Ordering matters, so having a file in ./settings.json as well as another in /etc/settings.json is still reliable. The configuration in ./settings.json will be used first. Prefer doesn't care what format your user writes your settings in, so they can also use settings.yaml if they like.

Supported configuration formats

Along with being fully configurable to support any arbitrary data source you'd like, the following types of data can immediately be used as configuration formats upon installation of prefer:

  • JSON / JSON5 (with comments, trailing commas, unquoted keys)
  • YAML
  • INI / CFG
  • XML

Why asyncronous?

In order to supply a more-simple method of getting the configuration, many configuration tools prefer to provide a blocking method of retrieving a project configuration. One goal of prefer is to ensure that we aren't limiting users to specific use-cases - and some projects require real-time, dynamic updating of their configuration. Prefer provides all it's interfaces as asyncronous functions in order to provide that possibility without the requirement that those actions are blocking.

Release files for prefer 0.2.1

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

Source distribution (sdist)

Source distribution for prefer 0.2.1
File Size Uploaded
prefer-0.2.1.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefer 0.2.1
File Interpreter ABI Platform
prefer-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / prefer-0.2.1.tar.gz

Download URL prefer-0.2.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c44825e664396cad2708b2989f1d872d82efab3c6e6a05a90b467c04af33e279
BLAKE2b-256 checksum
How to use checksums
0974f687aee32c988a70ce45c2eb47c2897a77cfe2b9ec0f04e4fab549a61d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2025.

Transparency log

Release files / prefer-0.2.1-py3-none-any.whl

Download URL prefer-0.2.1-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1acd77e812895341210c6cbdf3e799a633c65ee47f51307d29b313c74b103fa
BLAKE2b-256 checksum
How to use checksums
c3356d9a410c62897f5320d9b1ea9f21bf23441eae5417e405a353e45cd72eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

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