https://github.com/codl/py-devnullaas
python lib to discard data through devnull-as-a-service.com
https://github.com/codl/py-devnullaas
Last synced: 10 months ago
JSON representation
python lib to discard data through devnull-as-a-service.com
- Host: GitHub
- URL: https://github.com/codl/py-devnullaas
- Owner: codl
- License: bsd-3-clause
- Created: 2018-07-16T13:14:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T06:17:36.000Z (about 3 years ago)
- Last Synced: 2025-07-30T07:40:43.707Z (11 months ago)
- Language: Python
- Homepage: https://pypi.org/project/devnullaas
- Size: 38.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# py-devnullaas
is a python library to discard data through
and other DAAS endpoints.
## Installation
```
pip install devnullaas
```
## Usage
py-devnullaas provides `NullStream`, a file-like object to which you can write
`string`s or `bytes`...es. Whatever the plural of `bytes` is.
```python
from devnullaas import NullStream
devnull = NullStream()
password = 'hunter2'
devnull.write(password)
del password # once it has been discarded remotely,
# we can discard our local copy
```
### Endpoint configuration
By default, `NullStream` uses `https://devnull-as-a-service.com/dev/null`, but
you can specify any DAAS-compliant endpoint in the constructor:
```python
devnull = NullStream(endpoint="http://devnull.local/dev/null")
devnull.write('foobar')
```
> ⚠️ **Warning**: Discarding data with an untrusted endpoint may result in
> compromised data. Usage with untrusted endpoints is not recommended.
### Offline usage
`NullStream` can also be used offline by passing `None` as the endpoint. While
much faster, this does not ensure safe discarding of data and should only be
used in environments where no DAAS can be reached.
```python
devnull = NullStream(endpoint=None)
devnull.write('foobar')
# has it truly been discarded? 🤷 I dunno
```
## Disclaimer
While fully functional, this is a joke, and should not be taken seriously.
*Please* do not use this. *Please* especially do not use this in production. I
mean, if something like this somehow makes its way into production you have some
bigger problems to fix, but still.