Skip to content

Commit

Permalink
release: v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Oct 14, 2024
1 parent 45d8f81 commit ba76834
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Changes
=======

Version 2.0.0 (2024-09-30)
Version 2.0.0 (2024-10-15)

- Restructure module to be configurable and readable.

Expand Down
33 changes: 16 additions & 17 deletions idutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@

"""Small library for persistent identifiers used in scholarly communication.
Setting up custom schemes
------------------------
-------------------------
In order to define your own custom schemes you can use the following entrypoint to
register them
.. code-block:: python
[options.entry_points]
idutils.custom_schemes =
my_new_scheme = my_module.get_scheme_config_func
[options.entry_points]
idutils.custom_schemes =
my_new_scheme = my_module.get_scheme_config_func
The entry point ``'my_new_scheme = my_module.get_scheme_config_func'`` defines an entry
point named ``my_new_scheme`` pointing to the function ``my_module.get_scheme_config_func``
Expand All @@ -36,17 +35,17 @@
.. code-block:: python
def get_scheme_config_func():
return {
# See examples in `idutils.validators` file.
"validator": lambda value: True else False,
# Used in `idutils.normalizers.normalize_pid` function.
"normalizer": lambda value: normalized_value,
# See examples in `idutils.detectors.IDUTILS_SCHEME_FILTER` config.
"filter": ["list_of_schemes_to_filter_out"],
# Used in `idutils.normalizers.to_url` function.
"url_generator": lambda scheme, normalized_pid: "normalized_url",
}
def get_scheme_config_func():
return {
# See examples in `idutils.validators` file.
"validator": lambda value: True else False,
# Used in `idutils.normalizers.normalize_pid` function.
"normalizer": lambda value: normalized_value,
# See examples in `idutils.detectors.IDUTILS_SCHEME_FILTER` config.
"filter": ["list_of_schemes_to_filter_out"],
# Used in `idutils.normalizers.to_url` function.
"url_generator": lambda scheme, normalized_pid: "normalized_url",
}
Each key is optional and if not provided a default value is defined in
`idutils.ext._set_default_custom_scheme_config()` function.
Expand All @@ -62,7 +61,7 @@ def get_scheme_config_func():
stacklevel=2,
)

__version__ = "1.3.0"
__version__ = "2.0.0"


def import_attributes():
Expand Down

0 comments on commit ba76834

Please sign in to comment.