Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#export | |
from nicHelper.pynamodb import SuperModel | |
from pynamodb.attributes import JSONAttribute, NumberAttribute, UnicodeAttribute | |
class PaymentRecordTable(SuperModel): | |
data = JSONAttribute(null=True) | |
timestamp = NumberAttribute(hash_key=True) | |
userId = UnicodeAttribute() | |
def __init__(self, hash_key=None, range_key=None, _user_instantiated=True, **kwargs): |
This file contains hidden or 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
os.environ['AWS_PROFILE'] = 'tenxor' | |
os.environ['AWS_DEFAULT_PROFILE'] = 'tenxor' |
This file contains hidden or 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
extension Type: Codable { | |
public init(from decoder: Decoder) throws { | |
self = try Type(rawValue: decoder.singleValueContainer().decode(RawValue.self)) ?? .unknown | |
} | |
} |
This file contains hidden or 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 CodableCSV | |
extension VillaMarket{ | |
static func getOnlineCsv()async throws ->[Item]{ | |
let url = URL(string: "https://url/item.csv")! | |
let (data, _) = try await URLSession.shared.data(from: url) | |
let decoder = CSVDecoder{ | |
$0.bufferingStrategy = .sequential |
This file contains hidden or 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 | |
with open('/content/drive/MyDrive/example.json', 'w') as f: | |
json.dump({'key':'xxx','secret':'xxx'}, f) |
This file contains hidden or 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
s3 = boto3.client('s3', aws_access_key_id='xxx', aws_secret_access_key='xxx') |
This file contains hidden or 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
sudo apt update --allow-releaseinfo-change |