random-isbn

This will generate a random legal ISBN number.

CrISBN - Crystal ISBN Library

Language Not Working

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 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:

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 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 (https://github.com/MaterialFuture/crisbn/forks/new)
  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

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
Repository

random-isbn

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • over 4 years ago
  • December 23, 2019
License

MIT License

Links
Synced at

Thu, 21 Nov 2024 16:54:58 GMT

Languages