readma 1.0.3a0
Readma? What's Readma?
License: MIT
Requires Python: >=3.8

<h1 align="center">Readma? What's Readma?</h1>

### Readma is a binary stream reading library I made for fun that I decided I would extend on and release

> Well, what does it do?

### Well I'm glad you asked!

Readma is a little library I started to help with parsing binary files.

> That's it?

Well yeah, what did you expect?
Some large module I've been writing my entire life that will change the world with its amazing binary reading ability?

## Cool Badges
![Tests](https://github.com/whamer100/Readma/actions/workflows/tests.yml/badge.svg)
<br/><br/>
![](https://img.shields.io/badge/Shoutouts%20to-SimpleFlips-%23B6BFFF?link=https://www.twitch.tv/simpleflips&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAarSURBVEhLhVYJbBTXGf7fm9ljZne99pq1vbbBXrwmvoIxDjJ2RUXSKK6aBkWoJCJRGgQNKEhNr6hpxBFDK5UUoaolJGqrkELTRDFJCU1ETagxJBKGGmjAB8ZX1vYaH+ztPWbneH9n7Y2DaaR80q/33vf++Y838/5/4OuAiOTM1BmSWabX0KFzLjVub0bkrujrtKT5EZ1v1SWtN6ivt+vyjUg7+NOV5+YMILbCKH5Mqt5c4sye6djK4+yrNkwJGdVvBM2M/4ft9X+Gz+At8nRil+kYHKdMjDcKE52PoqoMGAHk05lI9ejnxrtxN7fgYD7aefkS+bKbhqTJrIt97VlUk80OfKeKfnHjvkQotiQPgBzSM+3Vx4z6Ap4gX1F0weipU3Msmd9Er9dLVhjXa03iEwEN5SyThdsjzg4d44rLE3Jg+pltikJ5XXEfIfrj80HdHdyXoHD4MNHKynLh9GkCJ04suO4q7cLzcIJ0hv7ewAoSj5sr0DbNfz+HJNQ6iAZTt0Ba/0kEyE9DSH7um88iE9wC0g4pJJPAGXkJLl4yQyikk8cJTG8km8AJuaCABoZhTuWcbBbPcf0dPoWxvcxTPo4RQ8WF5wPLj61mYvIFoO/uQnr8xeuk462OdEr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Gcgl4DR6pFgdqMTjip5DelwO66nwS0/aGjbbna1CfDFqXTZtNw14HOF4o/fhQJti4ueIv6AeJ2MOYIV3mBa0MJGSH0BlLoMk9oweSEJslThZ3a2KRdEZS/iesrjlC60ptiVLOQPFyLO6pvDQA9//ri8n1Pw3ERsztHQ4aNmMQVoHKbiYxjDy6x7KheIv5+Npn3D4gEN4qegr28sa6Ep+XVqwzbRDdrQBN1SmF/QoTSjKkM7nHwPqYmJws4CzqMpfQvalDdz6HtjVX5tsv52dUzJCnOWllyYF1ZTdT1qXbIlLr+cg26X/PRy9Gz2p532yP7a32XF2eQ7hlfwWcjEEYLz9OXhfsNPiG72AvQqG9cIk9WHmGeyvpYWu12C8D4riz1vtTDgw/mWwcvHr3p5xFfdJiLeoub9e/vZlrra4BjmwjO7KRSm82B1woWIknX9w7smOu1+t/Fos515jiSjUt/IzQYtpW25CjCAScaMltzWHxES2MIxho0ZddGoG5ywcoJXf4J6wn0tcCHECdX5+k5NP+Q4GNbn5aqGjxjDsrLDZtAzWzpAPgfZ5tYxYkh0PgAAAAASUVORK5CYII=)

## Usage

> Note, requires Python 3.8 or higher (For now at least)

### Installation

```sh
pip install readma
```

### Sample code

```py
from readma import Readma

# Let's say this file contains in order:
# - An integer
# - An unsigned integer
# - A float
# - A string prefixed by its length with a byte
# - An unknown amount of data you just really need read
r = Readma("some_file.bin") # note: defaults to Little Endian

integer = r.read(4) # size in bytes
unsigned_integer = r.uread(4)

a_float = r.float()

length = r.read(1)
string = r.bytes(length)

important_data = r.readall()
```

Example of ways to do the same action
```py
from readma import Readma, ReadmaTypes

r = Readma(b"AAAABBBBCCCCDDDD")

A = r.read(4)  # Reads a 32 bit (4 byte) integer
B = r.read("int")  # this also reads a 32 bit int
C = r.read(ReadmaTypes.int)  # someone might prefer this idk
D = r.bytes(4)  # its a bytestring, do whatever with it
```

You can also move around the buffer using seek, skip, and tell
```py
from readma import Readma

r = Readma(b"AAAABBCCCCXXXXXXXXDDDD")

A = r.read(4)
r.seek(6)  # seek past B
C = r.read(4)
r.skip(8)  # skip past the next 8 bytes
D = r.read(4)
```

Oh and you can check the size of the buffer too
```py
from readma import Readma

r = Readma(b"AAAABBBBCCCCDDDD")

assert r.size() == 16

# observe the script not halting
```

## Documentation

### [tba](https://www.youtube.com/watch?v=dQw4w9WgXcQ)

## License

Copyright (c) 2021 [whamer100](https://github.com/whamer100) <br />
This project is [MIT](https://github.com/whamer100/Readma/blob/master/LICENSE.md) licensed.

---
> hey is this project name just one big ligma joke
###### maybe