https://github.com/konstantine-v/crisbn
Crystal ISBN library to handle things like checking valid ISBN and generating random ones
https://github.com/konstantine-v/crisbn
books crystal crystal-lang crystal-library isbn-library
Last synced: 11 months ago
JSON representation
Crystal ISBN library to handle things like checking valid ISBN and generating random ones
- Host: GitHub
- URL: https://github.com/konstantine-v/crisbn
- Owner: konstantine-v
- License: mit
- Created: 2019-12-23T19:38:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T19:20:37.000Z (about 6 years ago)
- Last Synced: 2024-03-05T20:50:38.253Z (about 2 years ago)
- Topics: books, crystal, crystal-lang, crystal-library, isbn-library
- Language: Crystal
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CrISBN - Crystal ISBN Library
[](https://github.com/crystal-lang/crystal)

CrISBN - Crystal library to handle ISBNs. The goal is for this library to handle any action you'd want from an ISBN such as validate, generate new ones, check to see if an ISBN belongs to something and what, and other actions that come to mind.
**Note**: I will be changing this repo in the next coming commits to be a library rather than a random ISBN generator. I want to make something more purposeful than a one-off tool, hoever I want to still keep that generator as a function in the library.
Main Repository is the GitLab one
## Installation
- **Recommended:** if you want to use `cake`, which is `make` for crystal then, (this is recommended )
- Make sure you have cake installed `curl https://raw.githubusercontent.com/axvm/cake/master/install.sh | bash`
- Run `cake build`
- Run `./bin/crisbn`
- if you want to use `make` run `make build`
## Usage
Add it to your `shard.yml`:
```yml
dependencies:
crisbn:
github: MaterialFuture/crisbn
```
and then install the library into your project:
```bash
$ shards install
```
If you want to use this in your project just reference is with
```cr
ISBN::Generate.english
```
I also have a lottery-like variable that is used that could be used elsewhere, right now it's accessed like
```cr
RandNum.fromZero
```
or
```cr
RandNum.fromOne
```
You can also validate an ISBN by using like below
```cr
ISBN::Generate.english(ISBN)
```
For more examples look in `examples/` directory.
## Development
- All dev will be done in `src`
- Run using `crystal src/crisbn.cr`
- **Recommended:** if you want to use `cake`, which is `make` for crystal
- Make sure you have cake installed `curl https://raw.githubusercontent.com/axvm/cake/master/install.sh | bash`
- Run `cake build`
- Run `./bin/crisbn`
- if you want to use `make` run `make build`
## Spec/Test
Run `crystal spec` to make sure that all the tests pass before developing, and if there's anything that fails let me know or feel free to make a PR or issue.
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [MaterialFuture](https://github.com/materialfuture) - creator and maintainer
## Notes
ISBN number generated from list here:
#### Todo
- Change this to have more purpose, like an ISBN library so people can create, validate, search, convert to 10 or 13, etc.
- Add more language options
- Add support for Amazon's AISN
- Add Admiral cli and Table cli creation