Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
57 changes: 28 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

<img src="./docs/source/_static/images/logo_small.png" alt="Logo Small" style="float: right; width: 100mm">

Expand All @@ -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/)).
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <https://github.com/ArcanaFramework/fileformats-extras>`__
The `fileformats-extras <https://github.com/python-fileformats/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.

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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, `<https://github.com/ArcanaFramework/fileformats-medimage>`_,
the FileFormats extension template, `<https://github.com/python-fileformats/fileformats-medimage>`_,
including CI/CD workflows.

Extension packages add a new unique format namespace under the ``fileformats`` namespace package.
For example, the `FileFormats Medimage Extension <https://github.com/ArcanaFramework/fileformats-medimage>`__
For example, the `FileFormats Medimage Extension <https://github.com/python-fileformats/fileformats-medimage>`__
implements a range of file formats used in medical imaging research under the
``fileformats.medimage`` namespace.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer/extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/ArcanaFramework/fileformats-extension-template>`__,
`extension template <https://github.com/python-fileformats/fileformats-extension-template>`__,
to be called fileformats-<yournamespace>-extras.

Hooks and implementations
Expand All @@ -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-<yournamespace>-extras`, located in the `extras` directory in the
extension package root (see `<https://github.com/ArcanaFramework/fileformats-extension-template>`__
extension package root (see `<https://github.com/python-fileformats/fileformats-extension-template>`__
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.
Expand Down
12 changes: 6 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions extras/README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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
.. image:: https://img.shields.io/pypi/v/fileformats-extras.svg
: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 <https://github.com/ArcanaFramework/fileformats>`__ package, which provides
`fileformats <https://github.com/python-fileformats/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...

Expand Down
28 changes: 6 additions & 22 deletions extras/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }]
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ docs = [
]

[project.urls]
repository = "https://github.com/ArcanaFramework/fileformats"
repository = "https://github.com/python-fileformats/fileformats"


[tool.hatch.version]
Expand Down
Loading