diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae8230b1..eeb2a3f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -136,10 +136,10 @@ You can see a list of current contributors in our [zenodo file][link_zenodo]. If you are new to the project, don't forget to add your name and affiliation there! -[link_fileformats]: https://github.com/ArcanaFramework/fileformats +[link_fileformats]: https://github.com/python-fileformats/fileformats [link_signupinstructions]: https://help.github.com/articles/signing-up-for-a-new-github-account -[link_new_issues]: https://github.com/ArcanaFramework/fileformats/issues/new/choose -[link_doc_issues]: https://github.com/ArcanaFramework/fileformats/issues/new?assignees=&labels=documentation&template=documentation.md&title= +[link_new_issues]: https://github.com/python-fileformats/fileformats/issues/new/choose +[link_doc_issues]: https://github.com/python-fileformats/fileformats/issues/new?assignees=&labels=documentation&template=documentation.md&title= [link_pullrequest]: https://help.github.com/articles/creating-a-pull-request-from-a-fork/ [link_fork]: https://help.github.com/articles/fork-a-repo/ @@ -148,4 +148,4 @@ If you are new to the project, don't forget to add your name and affiliation the [link_push]: https://help.github.com/en/github/using-git/pushing-commits-to-a-remote-repository [link_commit]: https://git-scm.com/docs/git-commit -[link_zenodo]: https://github.com/ArcanaFramework/fileformats/master/.zenodo.json +[link_zenodo]: https://github.com/python-fileformats/fileformats/master/.zenodo.json diff --git a/README.md b/README.md index 2a554124..b6ce4997 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # FileFormats -[![CI/CD](https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml) -[![Codecov](https://codecov.io/gh/arcanaframework/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7)](https://codecov.io/gh/arcanaframework/fileformats) +[![CI/CD](https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml) +[![Codecov](https://codecov.io/gh/python-fileformats/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7)](https://codecov.io/gh/python-fileformats/fileformats) ![Static Badge](https://img.shields.io/badge/type%20checked-mypy-039dfc) [![Python Versions](https://img.shields.io/pypi/pyversions/fileformats.svg)](https://pypi.python.org/pypi/fileformats/) [![Latest Version](https://img.shields.io/pypi/v/fileformats.svg)](https://pypi.python.org/pypi/fileformats/) -[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://arcanaframework.github.io/fileformats/) +[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://python-fileformats.github.io/fileformats/) Logo Small @@ -22,7 +22,7 @@ locate data files, directories containing certain file types, or to peek at meta fields to define specific sub-types (e.g. functional MRI DICOM file set). These file-sets with auxiliary files can be moved, copied and hashed like they are a single file object. -See the [extension template](https://github.com/ArcanaFramework/fileformats-extension-template) +See the [extension template](https://github.com/python-fileformats/fileformats-extension-template) for instructions on how to design *FileFormats* extensions modules to augment the standard file-types implemented in the main repository with custom domain/vendor-specific file-format types (e.g. [fileformats-medimage](https://pypi.org/project/fileformats-medimage/)). @@ -34,11 +34,11 @@ added to *FileFormats* by semi-automatically scraping the [IANA MIME types](https://www.iana_mime.org/assignments/media-types/media-types.xhtml) website for file extensions and magic numbers. As such, many of the formats in the library have not been properly tested on real data and so should be treated with some caution. If you encounter any issues with an implemented file -type, please raise an issue in the [GitHub tracker](https://github.com/ArcanaFramework/fileformats/issues). +type, please raise an issue in the [GitHub tracker](https://github.com/python-fileformats/fileformats/issues). A small selection of vendor-specific types can be found under `fileformats.vendor.*`. Support for additional vendor-specific formats can be added via plugin (see the -[extension template](https://github.com/ArcanaFramework/fileformats-extension-template)). +[extension template](https://github.com/python-fileformats/fileformats-extension-template)). ## Installation @@ -71,14 +71,15 @@ and can be installed along with their "extras" package similarly Using the `WithMagicNumber` mixin class, the `Png` format can be defined concisely as ```python - from fileformats.generic import File - from fileformats.core.mixin import WithMagicNumber - - class Png(WithMagicNumber, File): - binary = True - ext = ".png" - iana_mime = "image/png" - magic_number = b".PNG" +from fileformats.generic import File +from fileformats.core.mixin import WithMagicNumber + + +class Png(WithMagicNumber, File): + binary = True + ext = ".png" + iana_mime = "image/png" + magic_number = b".PNG" ``` Files can then be checked to see whether they are of PNG format by @@ -123,7 +124,7 @@ restricted by using the `candidates` keyword argument. While not implemented in the main File-formats itself, file-formats provides hooks for other packages to implement extra behaviour such as format conversion. -The `fileformats-extras `__ +The `fileformats-extras `__ implements a number of converters between standard file-format types, e.g. archive types to/from generic file/directories, which if installed can be called using the `convert()` method. @@ -140,21 +141,19 @@ The converters are implemented in the [Pydra](https://pydra.readthedocs.io) data wider [Pydra](https://pydra.readthedocs.io) workflows by creating a converter task ```python - import pydra - from pydra.tasks.mypackage import MyTask - from fileformats.application import Json, Yaml - - wf = pydra.Workflow(name="a_workflow", input_spec=["in_json"]) - wf.add( - Yaml.get_converter(Json, name="json2yaml", in_file=wf.lzin.in_json) - ) - wf.add( - MyTask( - name="my_task", - in_file=wf.json2yaml.lzout.out_file, - ) +import pydra +from pydra.tasks.mypackage import MyTask +from fileformats.application import Json, Yaml + +wf = pydra.Workflow(name="a_workflow", input_spec=["in_json"]) +wf.add(Yaml.get_converter(Json, name="json2yaml", in_file=wf.lzin.in_json)) +wf.add( + MyTask( + name="my_task", + in_file=wf.json2yaml.lzout.out_file, ) - ... +) +... ``` Alternatively, the conversion can be executed outside of a [Pydra](https://pydra.readthedocs.io) workflow with diff --git a/docs/source/developer/extensions.rst b/docs/source/developer/extensions.rst index 2a188be5..0048f68c 100644 --- a/docs/source/developer/extensions.rst +++ b/docs/source/developer/extensions.rst @@ -7,11 +7,11 @@ still being flexible enough handle any weird whacky file formats used in obscure Format classes not covered by `IANA Media Types`_ should be implemented in a separate *FileFormats* extension packages. New extension packages can be conveniently created from -the FileFormats extension template, ``_, +the FileFormats extension template, ``_, including CI/CD workflows. Extension packages add a new unique format namespace under the ``fileformats`` namespace package. -For example, the `FileFormats Medimage Extension `__ +For example, the `FileFormats Medimage Extension `__ implements a range of file formats used in medical imaging research under the ``fileformats.medimage`` namespace. diff --git a/docs/source/developer/extras.rst b/docs/source/developer/extras.rst index dd388e86..2803a3e1 100644 --- a/docs/source/developer/extras.rst +++ b/docs/source/developer/extras.rst @@ -4,7 +4,7 @@ Extras The functionality in addition to the core validation and detection typically requires external dependencies and should be put into the separate `extras` project within the apa Please use an "extra" hook and implement the method in an "extras" package in the -`extension template `__, +`extension template `__, to be called fileformats--extras. Hooks and implementations @@ -18,7 +18,7 @@ validation, and should be implemented in a separate package if they have externa dependencies to keep the main and extension packages dependency free. The standard place to put these extras-implementations is in the sister "extras" package named `fileformats--extras`, located in the `extras` directory in the -extension package root (see ``__ +extension package root (see ``__ for further instructions). It is possible to implement extra methods in other modules, however, the extras package associated with formats namespace will be loaded by default when a hooked method is accessed. diff --git a/docs/source/index.rst b/docs/source/index.rst index 92c5bf7b..b02db392 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,19 +2,19 @@ FileFormats =========== -.. image:: https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml/badge.svg - :target: https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml -.. image:: https://codecov.io/gh/arcanaframework/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7 - :target: https://codecov.io/gh/arcanaframework/fileformats +.. image:: https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml/badge.svg + :target: https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml +.. image:: https://codecov.io/gh/python-fileformats/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7 + :target: https://codecov.io/gh/python-fileformats/fileformats .. image:: https://img.shields.io/pypi/pyversions/fileformats.svg :target: https://pypi.python.org/pypi/fileformats/ :alt: Supported Python versions .. image:: https://img.shields.io/pypi/v/fileformats.svg :target: https://pypi.python.org/pypi/fileformats/ :alt: Latest Version -.. image:: https://img.shields.io/github/stars/ArcanaFramework/fileformats?label=GitHub +.. image:: https://img.shields.io/github/stars/python-fileformats/fileformats?label=GitHub :alt: GitHub stars - :target: https://github.com/ArcanaFramework/fileformats + :target: https://github.com/python-fileformats/fileformats *Fileformats* is a Python library for file-type detection/validation, MIME-type lookup and file handling. diff --git a/extras/README.rst b/extras/README.rst index c59a224c..182031c5 100644 --- a/extras/README.rst +++ b/extras/README.rst @@ -1,9 +1,9 @@ FileFormats Extras ================== -.. image:: https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml/badge.svg - :target: https://github.com/arcanaframework/fileformats/actions/workflows/ci-cd.yml -.. image:: https://codecov.io/gh/arcanaframework/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7 - :target: https://codecov.io/gh/arcanaframework/fileformats +.. image:: https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml/badge.svg + :target: https://github.com/python-fileformats/fileformats/actions/workflows/ci-cd.yml +.. image:: https://codecov.io/gh/python-fileformats/fileformats/branch/main/graph/badge.svg?token=UIS0OGPST7 + :target: https://codecov.io/gh/python-fileformats/fileformats .. image:: https://img.shields.io/pypi/pyversions/fileformats-extras.svg :target: https://pypi.python.org/pypi/fileformats-extras/ :alt: Supported Python versions @@ -11,12 +11,12 @@ FileFormats Extras :target: https://pypi.python.org/pypi/fileformats-extras/ :alt: Latest Version .. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat - :target: https://arcanaframework.github.io/fileformats/ + :target: https://python-fileformats.github.io/fileformats/ :alt: Documentation Status This is a extras module for the -`fileformats `__ package, which provides +`fileformats `__ package, which provides additional functionality to format classes (i.e. aside from basic identification and validation), such as conversion tools, metadata parsers, test data generators, etc... diff --git a/extras/pyproject.toml b/extras/pyproject.toml index 9c344fae..434ccd63 100644 --- a/extras/pyproject.toml +++ b/extras/pyproject.toml @@ -7,10 +7,7 @@ name = "fileformats-extras" description = "Extra methods for accessing and manipulating the underlying data referenced by fileformats classes" readme = "README.rst" requires-python = ">=3.11" -dependencies = [ - "fileformats", - "pydra >=1.0a", -] +dependencies = ["fileformats", "pydra >=1.0a"] license = { file = "LICENSE" } authors = [{ name = "Thomas G. Close", email = "tom.g.close@gmail.com" }] maintainers = [{ name = "Thomas G. Close", email = "tom.g.close@gmail.com" }] @@ -32,31 +29,18 @@ dynamic = ["version"] [project.optional-dependencies] dev = ["black", "pre-commit", "codespell", "flake8", "flake8-pyproject"] -test = [ - "pytest >=6.2.5", - "pytest-env>=0.6.2", - "pytest-cov>=2.12.1", - "codecov", -] -application = [ - "PyYAML>=6.0", - "pydicom >=2.3", - "medimages4tests", -] +test = ["pytest >=6.2.5", "pytest-env>=0.6.2", "pytest-cov>=2.12.1", "codecov"] +application = ["PyYAML>=6.0", "pydicom >=2.3", "medimages4tests"] audio = [] -image = [ - "imageio >=2.24.0", -] +image = ["imageio >=2.24.0"] model = [] text = [] video = [] -vnd_openxmlformats = [ - "python-docx >= 1.2.0", -] +vnd_openxmlformats = ["python-docx >= 1.2.0"] [project.urls] -repository = "https://github.com/ArcanaFramework/fileformats" +repository = "https://github.com/python-fileformats/fileformats" [tool.hatch.version] source = "vcs" diff --git a/pyproject.toml b/pyproject.toml index 7c02cf34..49cafb67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ docs = [ ] [project.urls] -repository = "https://github.com/ArcanaFramework/fileformats" +repository = "https://github.com/python-fileformats/fileformats" [tool.hatch.version]