Skip to content

Commit

Permalink
0.9.5 (again) - fix: include AUTHORS.txt, regenerate some files
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed Jun 27, 2018
1 parent cfc8a40 commit c3b0b9d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 34 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,4 +1,5 @@
include LICENSE.MIT
include AUTHORS.txt
include MANIFEST.in
include NEWS
include README.*
Expand Down
74 changes: 40 additions & 34 deletions README.rst
Expand Up @@ -68,22 +68,24 @@ files in various formats and related functions:

- Loading configuration files:

**anyconfig.load** (path_specs, ac_parser=None, ac_template=False, ac_context=None, \*\*options)
loads configuration files or file/file-like objects and return a dict-like
object represents loaded configuration.
**anyconfig.load** (path_specs, ac_parser=None, ac_dict=None, ac_template=False, ac_context=None, \*\*options)
loads configuration data from `path_specs`. `path_specs` may be a list of
file paths, files or file-like objects, :class:`~pathlib.Path` object, a
namedtuple `~anyconfig.globals.IOInfo` objects represents some inputs to
load data from, and return a dict or dict like object, or a primitive
types' data other than dict represents loaded configuration.

**anyconfig.loads** (content, ac_parser=None, ac_template=False, ac_context=None, \*\*options)
loads configuration from a string just like json.loads does.
**anyconfig.loads** (content, ac_parser=None, ac_dict=None, ac_template=False, ac_context=None, \*\*options)
loads configuration data from a string just like json.loads does.

- Dumping configuration files:

**anyconfig.dump** (data, path_or_stream, ac_parser=None, \*\*options)
dumps a configuration file from a dict or dict-like object represents
configuration.
**anyconfig.dump** (data, out, ac_parser=None, \*\*options)
dumps a configuration data `data` in given format to the output `out`, may
be a file, file like object.

**anyconfig.dumps** (data, ac_parser=None, \*\*options)
dumps a configuration string from a dict or dict-like object represents
configuration.
dumps a configuration data loaded from a string

- Open configuration files:

Expand All @@ -96,20 +98,19 @@ files in various formats and related functions:
**anyconfig.merge** (self, other, ac_merge=MS_DICTS, \*\*options)
Update (merge) a mapping object `self` with other mapping object `other` or
an iterable `other` yields (key, value) tuples based on merge strategy
ac_merge.
`ac_merge`.

- Schema validation and generation of configuration files:

**anyconfig.validate** (data, schema, \*\*options)
validates configuration loaded with anyconfig.load() with JSON schema [#]_
(object) also loaded with anyconfig.load(). anyconfig.load() may help
**anyconfig.validate** (data, schema, ac_schema_safe=True, ac_schema_errors=False, \*\*options)
validates configuration data loaded with anyconfig.load() with JSON schema
[#]_ object also loaded with anyconfig.load(). anyconfig.load() may help
loading JSON schema file[s] in any formats anyconfig supports.

**anyconfig.gen_schema** (data, \*\*options)
generates a dict or dict-like object represents a minimum JSON schema to
validate given configuration file[s] later. This result object can be
serialized to any formats including JSON with anyconfig.dump or
anyconfig.dumps.
generates a mapping object represents a minimum JSON schema to validate
configuration data later. This result object can be serialized to any
formats including JSON with anyconfig.dump or anyconfig.dumps.

It enables to load configuration file[s] in various formats in the same manner,
and in some cases, even there is no need to take care of the actual format of
Expand All @@ -123,17 +124,22 @@ configuration file[s] like the followings:
# extension) in some cases.
conf1 = anyconfig.load("/path/to/foo/conf.d/a.yml")
# Similar to the above but load from file object opened:
# Similar to the above but the input is pathlib.Path object.
import pathlib
path_1 = pathlib.Path("/path/to/foo/conf.d/a.yml")
conf1_1 = anyconfig.load(path_1)
# Similar to the first one but load from file object opened:
with anyconfig.open("/path/to/foo/conf.d/a.yml") as fileobj:
conf1_1 = anyconfig.load(fileobj)
conf1_2 = anyconfig.load(fileobj)
# Loaded config data is a dict-like object, for example:
# Loaded config data is a mapping object, for example:
#
# conf1["a"] => 1
# conf1["b"]["b1"] => "xyz"
# conf1["c"]["c1"]["c13"] => [1, 2, 3]
# Or you can specify the format (config type) explicitly if automatic
# Or you can specify the format (config type) explicitly if its automatic
# detection may not work.
conf2 = anyconfig.load("/path/to/foo/conf.d/b.conf", ac_parser="yaml")
Expand All @@ -142,10 +148,10 @@ configuration file[s] like the followings:
conf2_2 = anyconfig.load(fileobj, ac_parser="yaml")
# Specify multiple config files by the list of paths. Configurations of each
# files are merged.
# files will be merged.
conf3 = anyconfig.load(["/etc/foo.d/a.json", "/etc/foo.d/b.json"])
# Similar to the above but all or one of config file[s] is/are missing:
# Similar to the above but all or one of config file[s] might be missing.
conf4 = anyconfig.load(["/etc/foo.d/a.json", "/etc/foo.d/b.json"],
ignore_missing=True)
Expand All @@ -156,7 +162,7 @@ configuration file[s] like the followings:
# overwritten by the later ones instead of merge:
conf6 = anyconfig.load("/etc/foo.d/*.json", ac_merge=anyconfig.MS_REPLACE)
Also, it can process configuration files which are actually
Also, it can process configuration files which are
`jinja2-based template <http://jinja.pocoo.org>`_ files:

- Enables to load a substantial configuration rendered from half-baked configuration template files with given context
Expand Down Expand Up @@ -204,7 +210,7 @@ with using JSON schema like the followings:
scm4 = anyconfig.gen_schema(conf4)
scm4_s = anyconfig.dumps(scm4, "json")
And you can query loaded data with JMESPath [#]_ expression:
And you can query loaded data with JMESPath [#]_ expressions:

.. code-block:: python
Expand Down Expand Up @@ -256,7 +262,7 @@ and backends in charge are enabled and ready to use:
ConifgObj, configobj, ``configobj`` [#]_
TOML, toml, ``toml`` [#]_

- Supported formats of which backends are enabled automatically if required pluggable modules are installed: python-anyconfig utilizes plugin mechanism provided by setuptools [#]_ and may support other formats if corresponding pluggable backend modules are installed along with python-anyconfig:
- Supported formats of which backends are enabled automatically if required plugin modules are installed: python-anyconfig utilizes plugin mechanism provided by setuptools [#]_ and may support other formats if corresponding plugin backend modules are installed along with python-anyconfig:

.. csv-table:: Supported formats by pluggable backend modules
:header: "Format", "Type", "Required backend"
Expand Down Expand Up @@ -309,7 +315,7 @@ disables specific features if required dependencies are not satisfied.
Therefore, only python standard library is required to install and use
python-anyconfig at minimum.

The following packages need to be installed along with python-anycofig to
The following packages need to be installed along with python-anyconfig to
enable the features.

.. csv-table::
Expand Down Expand Up @@ -338,9 +344,9 @@ There is a couple of ways to install python-anyconfig:

- Binary RPMs:

If you're running Fedora 27+ or CentOS, you can install RPMs from these
official yum repos. And you're running Red Hat Enterprise Linux 7 or later,
you can install RPMs from EPEL repos [#]_ .
If you're running Fedora 27 or later, or CentOS, you can install RPMs from
these official yum repos. And if you're running Red Hat Enterprise Linux 7 or
later, you can install RPMs from EPEL repos [#]_ .

Or if you want to install the latest version, optionally, you can enable my
copr repo, http://copr.fedoraproject.org/coprs/ssato/python-anyconfig/ .
Expand Down Expand Up @@ -379,8 +385,8 @@ Help and feedbak
-----------------

If you have any issues / feature request / bug reports with python-anyconfig,
please open an issue ticket on github.com
(https://github.com/ssato/python-anyconfig/issues).
please open issue tickets on github.com,
https://github.com/ssato/python-anyconfig/issues.

The following areas are still insufficient, I think.

Expand All @@ -390,7 +396,7 @@ The following areas are still insufficient, I think.
- Documentation:

- Especially API docs need more fixes and enhancements! CLI doc is non-fulfilling also.
- English is not my native lang and there are many wrong and hard-to-understand expressions.
- English is not my native lang and there may be many wrong and hard-to-understand expressions.

Any feedbacks, helps, suggestions are welcome! Please open github issues for
these kind of problems also!
Expand Down

0 comments on commit c3b0b9d

Please sign in to comment.