semvec/pypi-packages huggingface dataset:
swiftspec 0.0.4
fsspec implementation for OpenStack SWIFT
Requires Python: >=3.7

# swiftspec

```python
import fsspec

with fsspec.open("swift://server/account/container/object.txt", "r") as f:
    print(f.read())
```

## Authentication

`swiftspec` uses the environment variables `OS_STORAGE_URL` and `OS_AUTH_TOKEN` for authentication if available. To create these variables, you can use the `swift auth` command from the [python-swiftclient](https://docs.openstack.org/python-swiftclient/latest/cli/index.html).

## fault tolerance / automatic retry

Sometimes reading or writing from / to a swift storage might fail occasionally. If many objects are accessed, occasional failures can be extremely annoying and could be fixed relatively easily by retrying the request. Fortunately the `aiohttp_retry` package can help out in these situations. `aiohttp_retry` provides a wrapper around an `aiohttp` Client, which will automatically retry requests based on some user-provided rules. You can inject this client into the `swiftspec` filesystem using the `get_client` argument. First you'll have to define an async `get_client` function, which configures the `RetryClient` according to your preferences, e.g.:

```python
async def get_client(**kwargs):
    import aiohttp
    import aiohttp_retry
    retry_options = aiohttp_retry.ExponentialRetry(
            attempts=3,
            exceptions={OSError, aiohttp.ServerDisconnectedError})
    retry_client = aiohttp_retry.RetryClient(raise_for_status=False, retry_options=retry_options)
    return retry_client
```

afterwards, you can use this function like:

```python
with fsspec.open("swift://server/account/container/object.txt", "r", get_client=get_client) as f:
    print(f.read())
```

or:


```python
import xarray as xr
ds = xr.Dataset(...)
ds.to_zarr("swift://server/account/container/object.zarr", storage_options={"get_client": get_client})
```

## Develop

### Code Formatting

swiftspec uses [Black](https://black.readthedocs.io/en/stable) to ensure
a consistent code format throughout the project.
Run ``black .`` from the root of the swiftspec repository to
auto-format your code. Additionally, many editors have plugins that will apply
``black`` as you edit files.


Optionally, you may wish to setup [pre-commit hooks](https://pre-commit.com) to
automatically run ``black`` when you make a git commit.
Run ``pre-commit install --install-hooks`` from the root of the
swiftspec repository to setup pre-commit hooks. ``black`` will now be run
before you commit, reformatting any changed files. You can format without
committing via ``pre-commit run`` or skip these checks with ``git commit
--no-verify``.
object-to-xfile 0.0.3
Generate csv,xlxs,excel,pdf and html file from python dictionary objects
Keywords: python

# Object_to_xFile

Under construction! Not ready for use yet! Currently experimenting and planning!

Developed by Sachin Indoriya (c) 2022

## Examples of How To Use (Buggy Alpha Version)


```python 
from object_to_xfile.xconvertor  import XConverter

 
dummy_data = {['name':'John','age':23,'hobby':'reading'],['name':'Tom','age':23,'hobby':'coding']}

# create XConvertor object
x_convertor_obj = XConverter(dummy_data)


# for csv, call to_csv() methods
x_convertor_obj.to_csv()

# for html, call to_html() methods
x_convertor_obj.to_html()

# for excel, call to_excel() methods
x_convertor_obj.to_excel()

# for pdf, call to_pdf() methods
x_convertor_obj.to_pdf()

# for xml, call to_xml() methods
x_convertor_obj.to_xml()
```