Metadata-Version: 2.1
Name: httpfs-sync
Version: 0.0.1
Summary: Install requirements and run code in virtual environments from the comfort of your own GIL
Author-email: Nathan Zimmerman <npzimmerman@gmail.com>
License: MIT
Project-URL: homepage, https://github.com/moradology/httpfs-sync
Project-URL: repository, https://github.com/moradology/httpfs-sync.git
Keywords: virtualenv,dependencies
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fsspec
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Provides-Extra: lint
Requires-Dist: black>=23.9.1; extra == "lint"
Requires-Dist: isort>=5.13.0; extra == "lint"
Requires-Dist: flake8>=7.0.0; extra == "lint"
Requires-Dist: Flake8-pyproject>=1.2.3; extra == "lint"
Requires-Dist: mypy>=1.8.0; extra == "lint"
Requires-Dist: pre-commit>=3.4.0; extra == "lint"
Requires-Dist: pytest>=8.0.0; extra == "lint"
Requires-Dist: pytest-cov>=4.1.0; extra == "lint"
Requires-Dist: tox>=4.11.3; extra == "lint"

# httpfs-sync

## Overview
`httpfs-sync` is an implementation of a filesystem interface for the Python `fsspec`
library that uses synchronous requests based on `urllib3`. This serves as an alternative
to the default asynchronous (based on `aiohttp`) filesystem implementation provided by
`fsspec`. This project is ideal for environments where asynchronous operations are not
feasible or desired, allowing users to interact with HTTP-based filesystems using a
synchronous API.

If you're dealing with deadlocks potentially involving the default HTTP 'filesystem' in
`fsspec`, the implementation here may help with verification of behavior: just use the classes
provided here as a drop-in replacement for `HTTPFileSystem` and compare behaviors.

## Features
- Synchronous HTTP requests for file system operations.
- Fully compatible with the `fsspec` API, making it easy to drop in as a replacement.
- Uses `urllib3` for robust, production-ready HTTP communications.

## Installation

To install `httpfs-sync`, you can use pip:

```bash
pip install httpfs-sync
```

## Usage
Here's a simple example of how to use httpfs-sync to read a file from an HTTP server:
```python
import fsspec
from httpfs_sync.core import SyncHTTPFileSystem

# enable use of SyncHTTPFileSystem and associated files for both http and https
SyncHTTPFileSystem.overwrite_async_registration()

# Use the registered file system to access a remote file
with fsspec.open('http://example.com/data.txt', 'r') as f:
    data = f.read()
    print(data)
```

## License
httpfs-sync is distributed under the MIT License, allowing the code to be used in commercial applications as well as open-source projects.
