A sample python package deployment utility for SQLShack Demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imports the Pandas library to work in python | |
import pandas as pd | |
# assign the JSON data to a variable | |
json_data = """{ | |
"data": [ | |
{ | |
"type": "articles", | |
"id": "1", | |
"attributes": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imports the Pandas library to work in python | |
import pandas as pd | |
# Create the data as a list | |
data = [['Bob', 30], ['Fred', 35], ['Nick', 40]] | |
# Load the data as a dataframe | |
df = pd.DataFrame(data=data, columns=['Name','Age']) | |
# Covnert the dataframe to JSON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def greet(): | |
print('Hello user') | |
def main(): | |
greet() | |
if __name__ == '__main__': | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def greet(user): | |
print(f'Hello {user}') | |
def main(): | |
greet('Aveek') | |
if __name__ == '__main__': | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def pos_arg(a,b,c): | |
print(f'The value of a is: {a}') | |
print(f'The value of b is: {b}') | |
print(f'The value of c is: {c}') | |
def main(): | |
pos_arg(10,20,30) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def greet(*users): | |
for user in users: | |
print(f'Welcome {user}') | |
def main(): | |
greet('Fred', 'Harry', 'Tom') | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def greet(**users): | |
for key,value in users.items(): | |
print(f'{key} => {value}.') | |
def main(): | |
greet(user='Tom', city='London', pet=['Dog', 'Cat', 'Fish']) | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quicktext(): | |
print('Hello, welcome to QuickSample package.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import setuptools | |
with open("README.md", "r") as fh: | |
long_description = fh.read() | |
setuptools.setup( | |
name="quicksample", # This is the name of the package | |
version="0.0.1", # The initial release version | |
author="Aveek Das", # Full name of the author | |
description="Quicksample Test Package for SQLShack Demo", |