random-isbn
CrISBN - Crystal ISBN Library
Note: This repo is still a work in progress, changes are being made for the ISBN Generating process to be correct and produce the intended results. Other than that, Libraries for search and book info will be added in future commits. Pull requests welcomed.
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.
Main Repository is the GitLab one https://github.com/MaterialFuture/crisbn
Installation
- Recommended: if you want to use
cake
, which ismake
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
- Make sure you have cake installed
- if you want to use
make
runmake build
Usage
Add it to your shard.yml
:
dependencies:
crisbn:
github: MaterialFuture/crisbn
and then install the library into your project:
$ shards install
If you want to use this in your project just reference is with
ISBN::Generate.english
I also have a lottery-like variable that is used that could be used elsewhere, right now it's accessed like
RandNum.fromZero
or
RandNum.fromOne
You can also validate an ISBN by using like below
ISBN::Generate.english()
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 ismake
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
- Make sure you have cake installed
-
if you want to use
make
runmake 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
- Fork it (https://github.com/MaterialFuture/crisbn/forks/new)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- MaterialFuture - creator and maintainer
Notes
ISBN number generated from list here: https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_to_ISBN-13_conversion
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
random-isbn
- 0
- 0
- 0
- 0
- 0
- over 4 years ago
- December 23, 2019
MIT License
Wed, 06 Nov 2024 21:57:06 GMT