Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative clipboard feature package #41

Closed
pdeffebach opened this issue Apr 17, 2021 · 1 comment
Closed

Alternative clipboard feature package #41

pdeffebach opened this issue Apr 17, 2021 · 1 comment

Comments

@pdeffebach
Copy link

Hello!

I really like the functions xlcopy() and xlcopy(data). I think it's really awesome to have such easy interoperability with excel.

They seem so important that they probably shouldn't live in a domain-specific package like ActuaryUtilities. Everyone, even non-actuaries, should use this feature.

So I've created ClipboardCSV which takes some of the core features from xlcopy and puts them in a standalone package. Here are some examples of how it works

julia> using DataFrames, ClipboardCSV

julia> df = DataFrame(a = [1, 2], b = [3, 4], c = [5, 6], d = [7, 8])
2×4 DataFrame
 Row │ a      b      c      d     
     │ Int64  Int64  Int64  Int64 
─────┼────────────────────────────
   11      3      5      7
   22      4      6      8

julia> tabletoclip(df)
a,b,c,d
1,3,5,7
2,4,6,8


julia> cliptotable()
2-element CSV.File{false}:
 CSV.Row: (a = 1, b = 3, c = 5, d = 7)
 CSV.Row: (a = 2, b = 4, c = 6, d = 8)

julia> @tabletomwe df
df = """
a,b,c,d
1,3,5,7
2,4,6,8
""" |> IOBuffer |> CSV.File |> DataFrame



julia> eval(first(Meta.parse(clipboard(), 1)))
2×4 DataFrame
 Row │ a      b      c      d     
     │ Int64  Int64  Int64  Int64 
─────┼────────────────────────────
   11      3      5      7
   22      4      6      8

This package is not yet mature. It needs tests, a few more features, and documentation. However when all that is done and the package is released, would you consider deprecating xlcopy and taking ClipboardCSV.jl as a dependency?

@alecloudenback
Copy link
Member

alecloudenback commented Apr 17, 2021

Hey, thanks for the feedback - I had actually already split out the functionality based on some community feedback into ExcelUtilities.jl. And it's on the to-do list (#33) to directly use that dependency here.

I think that some of the ideas you have are very interesting - do you mind taking a look at ExcelUtilities.jl and then copying this issue over there for further discussion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants