Giter Site home page Giter Site logo

ramadani / adminarea-cli Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 19 KB

Administrative Area Command Line Interface (CLI)

License: MIT License

Go 100.00%
golang golang-library golang-cli cli command-line-tool administrative-areas indonesia provinces cities districts villages countries

adminarea-cli's Introduction

adminarea-cli

Administrative Area CLI

Features

  • Create db table
  • Save a country
  • Save the provinces of a country
  • Save the cities/regencies of a country
  • Save the districts of a country
  • Save the villages of a country

Available Countries

  • Indonesia (id)

Installation

To install the library and command line program, use the following:

go get -v github.com/ramadani/adminarea-cli/...

Usage

Create adminarea_config.yml and fill it with following this values:

db:
  driver: mysql
  dsn: user:password@tcp(127.0.0.1:3306)/dbname?parseTime=true

Available Commands

setup     Create administrative areas table
country   Save a country     province  Save the provinces of a country
city      Save the cities/regencies of a country
district  Save the districts of a country
village   Save the villages of a country

Create DB table

To create administrative_areas table to your database, run this command:

adminarea-cli setup

Save the country

// adminarea-cli country [COUNTRY_CODE_ID]
adminarea-cli country id

Save the provinces of a country

// adminarea-cli province [COUNTRY_CODE_ID]
adminarea-cli province id

Save the cities/regencies of a country

// adminarea-cli city [COUNTRY_CODE_ID]
adminarea-cli city id

Save the districts of a country

// adminarea-cli district [COUNTRY_CODE_ID]
adminarea-cli district id

Save the villages of a country

// adminarea-cli village [COUNTRY_CODE_ID]
adminarea-cli village id

TODO

  • Can create db table
  • Config file can pass by argument
  • Save a country
  • Save provinces by country
  • Save regencies by country
  • Save districts by country
  • Save villages by country

References

License

This library is distributed under the MIT license.

adminarea-cli's People

Contributors

ramadani avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.