Skip to content

Commit b01cf28

Browse files
committed
[AVRO]: Documentation added for AVRO
1 parent 8b7bf32 commit b01cf28

File tree

12 files changed

+133
-32
lines changed

12 files changed

+133
-32
lines changed

Diff for: blog/welcome.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
id: welcome
33
title: Welcome
44
author: Ashish Patel
5-
authorTitle: Software Engineer at Deutsche Bank
6-
authorURL: https://github.com/ashishpatel0720
5+
authorTitle: Software Engineer
6+
authorURL: https://github.com/pateash
77
authorImageURL: https://avatars0.githubusercontent.com/u/16856802?s=460&v=4
88
authorTwitter: ashishpatel0720
99
tags: [CodingTools, Welcome, Cdt]

Diff for: docs/cdt/commands/avro.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
id: avro
3+
title: avro
4+
sidebar_label: avro
5+
---
6+
### `cdt avro [COMMAND]`
7+
8+
avro functionality, allows user to generate and inspect Avro files.
9+
10+
``` bash
11+
USAGE
12+
cdt avro [COMMAND]
13+
Avro Utility command
14+
15+
USAGE
16+
$ cdt avro [COMMAND]
17+
18+
OPTIONS
19+
-c, --command=command commands supported: get_schema,to_json,to_avro,to_csv
20+
-f, --file=file input file path
21+
-h, --help show CLI help
22+
-o, --output=output output file path
23+
-t, --schemaType=schemaType schema type file path### Finding avro of a given string for default type ( SHA1 )
24+
```
25+
26+
------
27+
28+
### Finding Schema for an Avro file
29+
> We can use -f or --file flag to pass input file
30+
31+
``` bash
32+
$ cdt avro get_schema -f 'test/resources/avro/person.avro'
33+
✔ success Avro Schema
34+
{
35+
"name": "Person",
36+
"type": "record",
37+
"fields": [
38+
{
39+
"name": "ID",
40+
"type": "long"
41+
},
42+
{
43+
"name": "First",
44+
"type": "string"
45+
},
46+
{
47+
"name": "Last",
48+
"type": "string"
49+
},
50+
{
51+
"name": "Phone",
52+
"type": "string"
53+
},
54+
{
55+
"name": "Age",
56+
"type": "int"
57+
}
58+
]
59+
}
60+
```
61+
62+
> We can also use -o or --output flag to pass output file ( optional ), if you want output in some file.
63+
64+
``` bash
65+
$ cdt avro get_schema -f 'test/resources/avro/person.avro' -o 'schema.avsc'
66+
ℹ info Could not find file: schema.avsc, creating new one
67+
✔ success output written to file: schema.avsc
68+
```
69+
------
70+
71+
### Extracting data from an Avro file
72+
> Supported Output types - CSV and JSON
73+
> use to_json and to_csv command to extract data in JSON and CSV format respectively.
74+
75+
``` bash
76+
$ cdt avro to_json -f 'test/resources/avro/person.avro' -o 'test/resources/avro/output/person.json'
77+
✔ Converting Avro To Json
78+
⚠ warning File already exists: test/resources/avro/output/person.json, overriding content
79+
✔ success Json written to file: test/resources/avro/output/person.json
80+
```
81+
> If file already exists, it will be overridden in the process.
82+
83+
------
84+
85+
### Generating Avro file
86+
> for generating Avro file, you must provide Schema ( -t or --type flag ) along with Input and Output file paths.
87+
> schema file(.avsc) can be created manually or generated using **get_schema** command
88+
89+
``` bash
90+
$ cdt avro to_avro -f 'test/resources/avro/twitter.json' -o 'test/resources/avro/output/twitter.avro' -t 'test/resources/avro/twitter.avsc'
91+
✔ Generating Avro
92+
ℹ info reading file: test/resources/avro/twitter.json
93+
✔ success Avro written to file: test/resources/avro/output/twitter.avro
94+
```

Diff for: docs/cdt/commands/hash.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
id: hash
3-
title: Hash
4-
sidebar_label: Hash
3+
title: hash
4+
sidebar_label: hash
55
---
66
### `cdt hash [STRING]`
77

8-
Hashing functionality for a string/file
8+
Hashing functionality, allows user to Hash String/File for all supported types.
99

1010
``` bash
1111
USAGE

Diff for: docs/cdt/commands/minify.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
id: minify
3-
title: Minify
4-
sidebar_label: Minify
3+
title: minify
4+
sidebar_label: minify
55
---
66
### `cdt minify [FILE]`
77

8-
Minify functionality for a string/file
8+
Minify functionality, Allows user to minify supported file.
99

1010
``` bash
1111
USAGE

Diff for: docusaurus.config.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@
66
*/
77

88
module.exports = {
9-
title: 'CodingTools Documentation',
10-
tagline: 'Documentation for Coding Tools Utility',
9+
title: 'CodingTools',
10+
tagline: 'Documentation @codingtools/cdt',
1111
url: 'https://codingtools.github.io',
1212
baseUrl: '/',
13-
favicon: 'img/favicon.ico',
13+
favicon: 'img/favicon/favicon.ico',
1414
organizationName: 'codingtools', // Usually your GitHub org/user name.
1515
projectName: 'codingtools.github.io', // Usually your repo name.
1616
themeConfig: {
1717
navbar: {
1818
title: 'CodingTools',
1919
logo: {
2020
alt: 'CodingTools',
21-
src: 'img/logo.svg',
21+
src: 'img/cdt_docs_website.png',
22+
2223
},
2324
links: [
24-
{to: 'docs/cdt/installation', label: 'Cdt Docs', position: 'left'},
25+
{to: 'docs/cdt/commands/avro', label: 'Docs', position: 'left'},
26+
{to: 'docs/cdt/installation', label: 'Installation', position: 'left'},
2527
{to: 'blog', label: 'Blog', position: 'left'},
28+
{to: 'Slack', label: 'Join Slack', position: 'right'},
2629
{
2730
href: 'https://github.com/codingtools/',
2831
label: 'GitHub',
@@ -38,16 +41,16 @@ module.exports = {
3841
items: [
3942
{
4043
label: 'Docs',
41-
to: 'docs/doc1',
44+
to: 'docs/cdt/installation',
4245
},
4346
],
4447
},
4548
{
4649
title: 'Community',
4750
items: [
4851
{
49-
label: 'Discord',
50-
href: 'https://discordapp.com/invite/docusaurus',
52+
label: 'Slack',
53+
href: 'https://join.slack.com/t/codingtools/shared_invite/zt-qbls6zzm-ZN8VvlVTg3enPLUdw6yluA',
5154
},
5255
],
5356
},
@@ -62,10 +65,10 @@ module.exports = {
6265
},
6366
],
6467
logo: {
65-
alt: 'Facebook Open Source Logo',
66-
src: 'https://docusaurus.io/img/oss_logo.png',
68+
alt: 'CodingTools',
69+
// src: 'img/LogoMakr_logo2.png',
6770
},
68-
copyright: `Copyright © ${new Date().getFullYear()} CodingTools`,
71+
copyright: `Copyright ©CodingTools, 2019-${new Date().getFullYear()}.`,
6972
},
7073
},
7174
presets: [

Diff for: sidebars.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ module.exports = {
1313

1414
cdt: {
1515
'Getting Started': ['cdt/installation'],
16-
'Commands': ['cdt/commands/hash','cdt/commands/minify'],
16+
'Commands': [
17+
'cdt/commands/avro',
18+
'cdt/commands/hash',
19+
'cdt/commands/minify'
20+
],
1721

1822
},
1923
};

Diff for: src/pages/index.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ import styles from './styles.module.css';
1616
const features = [
1717
{
1818
title: <>Easy to Use</>,
19-
imageUrl: 'img/undraw_docusaurus_mountain.svg',
19+
imageUrl: 'img/LogoMakr_logo.png',
2020
description: (
2121
<>
22-
Docusaurus was designed from the ground up to be easily installed and
23-
used to get your website up and running quickly.
22+
CodingTools Allows Users to install and start using <b>@codingtools/cdt</b> very quickly,
23+
Just install via npm or yarn and you are good to go.
2424
</>
2525
),
2626
},
2727
{
28-
title: <>Focus on What Matters</>,
29-
imageUrl: 'img/undraw_docusaurus_tree.svg',
28+
title: <>Fully Customizable</>,
29+
imageUrl: "img/LogoMakr_logo.png",
3030
description: (
31-
<>
32-
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
33-
ahead and move your docs into the <code>docs</code> directory.
34-
</>
31+
<>
32+
Feel free to add or change anything as per your need, as <b>@codingtools/cdt</b> is powered by MIT license.
33+
</>
34+
3535
),
3636
},
3737
{
38-
title: <>Powered by React</>,
39-
imageUrl: 'img/undraw_docusaurus_react.svg',
38+
title: <>Powered by OClif Framework</>,
39+
imageUrl: 'https://avatars.githubusercontent.com/u/35625753?s=460&u=8fb36e7eb3a1ae53d9fddc4ae4e2d40c6597e2b9&v=1',
4040
description: (
4141
<>
4242
Extend or customize your website layout by reusing React. Docusaurus can
@@ -53,6 +53,7 @@ function Feature({imageUrl, title, description}) {
5353
{imgUrl && (
5454
<div className="text--center">
5555
<img className={styles.featureImage} src={imgUrl} alt={title} />
56+
{/*<img className={styles.featureImage} src="img/LogoMakr_logo.png" alt={title} />*/}
5657
</div>
5758
)}
5859
<h3>{title}</h3>

Diff for: static/img/LogoMakr_logo.png

15 KB
Loading

Diff for: static/img/LogoMakr_logo2.png

12.8 KB
Loading

Diff for: static/img/cdt_docs_website.png

194 KB
Loading

Diff for: static/img/favicon/favicon_io.zip

223 KB
Binary file not shown.

Diff for: static/img/logo.svg

-1
This file was deleted.

0 commit comments

Comments
 (0)